kts Posted December 17, 2007 Share Posted December 17, 2007 I am trying to select * from a table inside the function and then remotely display it. I know the code I have is wrong, but its what I could try to logically come up with, but I can't find any examples anywhere. If someone wouldn't mind I'd appreciate the help. Thanks a lot. function show_all_lyrics() { global $show_all_lyrics_row; $query = "SELECT * FROM lyrics ORDER BY band ASC"; $result = mysql_query($query) or die(mysql_error()); while($show_all_lyrics_row = mysql_fetch_row($result)){ } } //$row = while (show_all_lyrics()){ database_connect($host, $user, $pass, $db); show_all_lyrics(); echo $show_all_lyrics_row[3]; Link to comment https://forums.phpfreaks.com/topic/82071-question-with-functions-and-mysql-selecting/ Share on other sites More sharing options...
kts Posted December 17, 2007 Author Share Posted December 17, 2007 aftering looking into this further, i believe i am taking an incorrect approach. instead of the code does anyone have any good sites to read up more on this topic? or possibly code/tutorial with this topic inside of it? Link to comment https://forums.phpfreaks.com/topic/82071-question-with-functions-and-mysql-selecting/#findComment-417084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.