xshanelarsonx Posted February 12, 2007 Share Posted February 12, 2007 I'm trying to randomly pick a row from a mysql table and display it's info. I keep getting a error on line 2. $Music="SELECT * from songs ORDER BY RND() LIMIT 1"; $Music_Result=mysql_query($Music); while ($row=mysql_fetch_array($Music_Result)) { $SongNameRandom=$row["SongName"]; $FileRandom=$row["File"]; } Quote Link to comment https://forums.phpfreaks.com/topic/38102-solved-mysql-problem/ Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 It helps to know which line is six. The mysql keyword is rand, not rnd. $Music_Result=mysql_query($Music) or die(mysql_error()); would give you a better error. Quote Link to comment https://forums.phpfreaks.com/topic/38102-solved-mysql-problem/#findComment-182411 Share on other sites More sharing options...
The Little Guy Posted February 12, 2007 Share Posted February 12, 2007 Its RAND, not RND Quote Link to comment https://forums.phpfreaks.com/topic/38102-solved-mysql-problem/#findComment-182415 Share on other sites More sharing options...
xshanelarsonx Posted February 12, 2007 Author Share Posted February 12, 2007 Its RAND, not RND Thank you, this fixed it. Thanks Jesirose for pointing that out. For now on I'll tell what row it is with that code, I was using the whole page when it told me that row. LOL Quote Link to comment https://forums.phpfreaks.com/topic/38102-solved-mysql-problem/#findComment-182419 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.