Jump to content
MakeWebGames

Recommended Posts

Posted

Can anyone help me with this, every time i echo it out it just returns "Array".

 

$sql = mysql_query("SELECT `W_Name` FROM `weapons` ORDER BY RAND() LIMIT 1");
$found_sql = mysql_fetch_array($sql);
echo $found_sql;

 

Thanks for the help in advance. :)

Posted

I would personally do it like that:

For small table, order by rand is a solution...

For bigger tables DO NOT use it instead:

"SELECT COUNT(*) FROM MY_TABLE"

"SELECT * FROM MY_TABLE LIMT ".rnd($maxrow).",1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...