<?
include("mysql.class.php");
$db = new MYSQL;
$db->Connect("test","webuser","2vd46r1s");
$fields["username"] = "CHAR(255) NOT NULL";
$fields["password"] = "CHAR(255)";
$fields["last_access"] = "TIMESTAMP";
$db->CreateTable("users", $fields, "username", "PRIMARY KEY");
$record["username"] = "sinan";
$record["password"] = crypt("sinanpass"); // Maybe I used the wrong function here.
$db->Insert("users", $record);
$users = $db->SelectSet("users");
foreach( $users as $user ){
echo $user["username"].", accessed last at".date("m / d / Y, H:m:i", $user["lastaccess"]);
}
$db->Disconnect();
?>
|