elite_prodigy Posted March 31, 2008 Share Posted March 31, 2008 $get_url = 'SELECT * FROM `main_nav`; LIMIT 0, 30 '; $get_url_res = mysql_query($get_articles,$conn) or die(mysql_error()); while ($url_array = mysql_fetch_array($get_url_res)) { $url = $url_array; $value = $url_array[value]; $display_url .= "<a href=\"$url\"> $value </a><br/><br/>"; } echo $display_url; I simply wanted to test whether or not this was outputting correctly before implementation, but it is not working. I keep getting a querry was empty message where there is stuff in that table! So, can someone tell me whats wrong? Please? :'( :'( Link to comment https://forums.phpfreaks.com/topic/98878-query-was-empty-now-what-did-i-do-wrong/ Share on other sites More sharing options...
trq Posted March 31, 2008 Share Posted March 31, 2008 Your query is stored within the $get_url variable yet your parsing $get_articles to mysql_query. When you get there, your query has a syntax error also. Should be.... $get_url = 'SELECT * FROM main_nav LIMIT 0, 30'; Link to comment https://forums.phpfreaks.com/topic/98878-query-was-empty-now-what-did-i-do-wrong/#findComment-505951 Share on other sites More sharing options...
marklarah Posted March 31, 2008 Share Posted March 31, 2008 try $display_url = '<a href="'.$url.'">'.$value .'[/url]'; Link to comment https://forums.phpfreaks.com/topic/98878-query-was-empty-now-what-did-i-do-wrong/#findComment-505952 Share on other sites More sharing options...
elite_prodigy Posted March 31, 2008 Author Share Posted March 31, 2008 Your query is stored within the $get_url variable yet your parsing $get_articles to mysql_query. When you get there, your query has a syntax error also. Should be.... $get_url = 'SELECT * FROM main_nav LIMIT 0, 30'; Thanks!!! I knew it was something so simple. I've been copy/pasting code from one section of my site to another because every thing works on the same principle with just a bit of editing. (guess I should have loooked closer!) Thanks again! You guys/girls are awsome! Ausgehtzeichet! Link to comment https://forums.phpfreaks.com/topic/98878-query-was-empty-now-what-did-i-do-wrong/#findComment-505958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.