thanks, but i dont quite understand.
Ive done the following now:
<?
$db_name = "db";
$table_name = "users";
$connection = @mysql_connect("host", "username", "pw")or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");
$chk_id = "SELECT * FROM $table_name WHERE username = \"$username\" and password = \"$password\"";
$chk_id_res = @($chk_id,$connection) or die("Couldn't execute query.");
$chk_id_num = mysql_num_rows($chk_id_res);
if ($chk_id_num == "0" or $password == "" or $username == "") {
echo "<font color=red>The Password or Username you entered was incorrect, or you have not entered one yet, please login:<br></font><form method=post action=/clandb/login.php><p>username: <input name=username ></p><p>password:<input name=password size=9 ></p><p><input type=submit value=Submit name=B1></p></form>";
} else {
$sql = "SELECT * FROM $table_name WHERE username = \"$username\" and password = \"$password\"";
$result = @($sql,$connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
$clanid = $row['clanid'];
$userid = $row['userid'];
$time = $row['time'];
$username = $row['username'];
$password = $row['password'];
$defpass = $row['defpass'];
$status = $row['status'];
$email = $row['email'];
$icq = $row['icq'];
}
session_start();
if (!$PHPSESSID) {
session_register('sesuserid');
session_register('sesclanid');
} else if ((!$sesuserid) || (!$sesclanid)) {
session_register('sesuserid');
session_register('sesclanid');
}
if (!$sesuserid) {
$sesuserid = "$userid";
}
if (!$sesclanid) {
$sesclanid = "$clanid";
}
echo "Userid $sesuserid<br>$sesclanid";
...
but still get the same error.
Thanks