jaxdevil Posted September 20, 2008 Share Posted September 20, 2008 The below query is not returning results. It is something wrong in that query. There are two queries below, the second one does return the values I am looking for, the first one does not, so the variable is being sent properly to the page ( $model_number ) but the first query never returns any results. Please check it and see if you see any errors. Thanks! SK <?php require($_SERVER['DOCUMENT_ROOT'].'/includes/configs/sql_connect.php'); $sql_media = "SELECT * FROM `products_media` WHERE `model_number`='$model_number' OR `number_search`='$model_number'"; $query_media = mysql_query($sql_media); while($media = mysql_fetch_array($query_media)){ $image_file = $media['image_file']; $image_file_thumb = $media['image_file_thumb']; $pdf_specs = $media['pdf_specs']; $pdf_specs_thumb = $media['pdf_specs_thumb']; $pdf_one = $media['pdf_one']; $pdf_one_thumb = $media['pdf_one_thumb']; $pdf_two = $media['pdf_two']; $pdf_two_thumb = $media['pdf_two_thumb']; $pdf_three = $media['pdf_three']; $pdf_three_thumb = $media['pdf_three_thumb']; $pdf_four = $media['pdf_four']; $pdf_four_thumb = $media['pdf_four_thumb']; } $sql_info = "SELECT * FROM `products` WHERE `model_number`='$model_number' OR `number_search`='$model_number'"; $query_info = mysql_query($sql_info); while($info = mysql_fetch_array($query_info)){ $manufacturer = $info['manufacturer']; $model_number = $info['model_number']; $name = $info['name']; } ?> Link to comment https://forums.phpfreaks.com/topic/125117-solved-sql-query-not-working/ Share on other sites More sharing options...
peranha Posted September 20, 2008 Share Posted September 20, 2008 $query_media = mysql_query($sql_media) or die(mysql_error()); Change your query line to that and see what it says. Link to comment https://forums.phpfreaks.com/topic/125117-solved-sql-query-not-working/#findComment-646643 Share on other sites More sharing options...
jaxdevil Posted September 20, 2008 Author Share Posted September 20, 2008 Thank you man! I completely forgot to try that. I would have taken days to remember to. I found the problem and fixed it. Thanks! SK Link to comment https://forums.phpfreaks.com/topic/125117-solved-sql-query-not-working/#findComment-646647 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.