Jump to content

This Query Will Run In phpmyadmin, not through php


hansman

Recommended Posts

Here is my code

 

...$zip is from $_POST['zip']

 

 if (preg_match("/^\w{1,10}$/", $zip, $matches))
{
echo $zip;
$query = "SELECT Companies.Name, Companies.Phone, Companies.ZipCodes, Zips.ZipCode FROM Companies, Zips Where Zips.ZipCode='$zip'"; 
}
    
else{ // we don't bother querying the database
   echo "Not A Valid Zip Code";
}

while($row = mysql_fetch_array($query)){
echo "Zip Code Phone Numbers: " . $row['Companies.Phone'];
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.