<?php
mysql_select_db($database_highstreetradio, $highstreetradio);
$query_checkuser = "SELECT * FROM user WHERE username = '$POST[username]' AND password = '$POST[password]'";
$checkuser = mysql_query($query_checkuser, $highstreetradio) or die(mysql_error());
$row_checkuser = mysql_fetch_assoc($checkuser);
$totalRows_checkuser = mysql_num_rows($checkuser);
?>
<head>
</head>
<body>
I still get "Query was empty" This is what i have now. I added the period after mysql error and that broke.. I removed those again.
-------this part is an include file ----------
<?php
FileName="Connection_php_mysql.htm"
Type="MYSQL"
HTTP="true"
$hostname_highstreetradio = "localhost";
$database_highstreetradio = "database";
$username_highstreetradio = "username";
$password_highstreetradio = "password";
$highstreetradio = mysql_pconnect($hostname_highstreetradio, $username_highstreetradio, $password_highstreetradio) or die(mysql_error());
?>
<?php
$user = $totalRows_checkuser;
if ($user = "0") {
print "<SCRIPT> document.location.href='index.php'; </SCRIPT>\n";
} elseif ($user = "1") {
$uname = $_POST["username"];
mysql_query($query_updatesession) or die(mysql_error());
$currentdate = date("Y-m-d H:i:s");
$query_updatesession = "UPDATE user SET sessiondate = '$currentdate' WHERE username = '$uname'";
}
?>
</body>
<?php
mysql_free_result($checkuser);
?>