hansman Posted August 21, 2008 Share Posted August 21, 2008 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']; } Link to comment https://forums.phpfreaks.com/topic/120702-this-query-will-run-in-phpmyadmin-not-through-php/ Share on other sites More sharing options...
revraz Posted August 21, 2008 Share Posted August 21, 2008 You didn't use mysql_query($query) anywhere in your code. Link to comment https://forums.phpfreaks.com/topic/120702-this-query-will-run-in-phpmyadmin-not-through-php/#findComment-622009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.