mysql_query where statment help

Posted by Anders Kitson on Stack Overflow See other posts from Stack Overflow or by Anders Kitson
Published on 2010-05-16T22:00:08Z Indexed on 2010/05/16 22:10 UTC
Read the original article Hit count: 229

Filed under:
|
|

I am retrieving values from the url with the GET method and then using a if statement to determine of they are there then query them against the database to only show those items that match them, i get an unknown error with your request. here is my code

$province = $_GET['province'];
$city = $_GET['city'];

if(isset($province) && isset($city) ) {         
  $results3 = mysql_query("SELECT * 
                            FROM generalinfo 
                           WHERE province = $province 
                             AND city = $city  ") 
                       or die( "An unknown error occurred with your request");          
} else {             
  $results3 = mysql_query("SELECT * FROM generalinfo");  
} /*if statement ends*/

© Stack Overflow or respective owner

Related posts about php

Related posts about where