Re: Unknown column 'peterspeters' in 'where clause'

From: Date: Wed, 18 May 2005 08:16:21 +0000
Subject: Re: Unknown column 'peterspeters' in 'where clause'
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-215448@lists.php.net to get a copy of this message
If customer_username is a string (char, varchar, text etc.) then I guess it should be mysql_query("SELECT customer_id FROM Customers WHERE customer_username = \"$username\" AND customer_password = \"$password\"") Prathap ---------- Original Message ----------- From: Mark Sargent <powderkeg@snow.email.ne.jp> To: php-general@lists.php.net Sent: Wed, 18 May 2005 15:27:34 +0900 Subject: [PHP] Unknown column 'peterspeters' in 'where clause' > 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. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php ------- End of Original Message -------

« previous php.general (#215448) next »