Page 1 of 1

Problem with error?

Posted: Fri Sep 20, 2002 2:59 pm
by Skywalker
You have an error in your SQL syntax near '' at line 1


THIS LINE ONE <?php require_once('Connections/Verbinding.php'); ?>



<?php
$Table = $_POST['Pakket'];

mysql_select_db($database_Verbinding, $Verbinding);
$query_Recordset1 = "SELECT Username,Password FROM $Table";
$Recordset1 = mysql_query($query_Recordset1, $Verbinding) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);



$Password = $_POST['Password'];
$Username = $_POST['Username'];

$Found = 0;
do {
If($Password == $row_Recordset1['Password'] && $Username == $row_Recordset1['Username']) {
$Found = 1;
}
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));

if ($Found == 1)
echo ("Login gegevens zijn corect <META HTTP-EQUIV=\"refresh\" content=\"2;URL=virtual-home.htm\"><br>\n");
else
echo ("Login gegevens zijn niet corect <META HTTP-EQUIV=\"refresh\" content=\"2;URL=index.htm\"><br>\n");


?>

Posted: Fri Sep 20, 2002 3:20 pm
by ~J~R~R
Line 1 means line 1 of your query. Are you sure $Table has a correct value? Check it with an echo.

Posted: Sat Sep 21, 2002 4:31 am
by Takuma
Also do you have the columns that you have specified?

Posted: Sat Sep 21, 2002 4:34 am
by Coco
try putting $table in ' s
i always thought that you could put variables in queries without having them in inverted commas... but i tried it last night myself and it didnt work...