Unknown column 'peterspeters' in 'where clause'
| From: | Mark Sargent | Date: | Wed, 18 May 2005 06:27:34 +0000 |
| Subject: | Unknown column 'peterspeters' in 'where clause' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-215444@lists.php.net to get a copy of this message | ||
Hi All,
the below code generates this error,
Unknown column 'peterspeters' in 'where clause'
mysql_select_db("status", $db);
$username = $_POST["username"];
$password = $_POST["password"];
$result = mysql_query("SELECT customer_id FROM Customers WHERE customer_username = $username AND customer_password = $password") or die (mysql_error());
$myrow = mysql_fetch_row($result);
$customer_id = $myrow[0];
$_SESSION['customer_id'] = $customer_id;
?>
</head>
<body>
<?php
echo 'SQL Query: '.$result.'<br>';
echo "CustomerID = $customer_id";
?>
Cheers.
Mark Sargent.