Forum Moderators: coopster
$query = "SELECT item FROM database WHERE item_name = '$name' LIMIT 1"; Okay, the above query will return the first instance of item where it matches item_name. Is there a way to return a single random result using a query.
I could always grab the whole list and then randomly pick one out using php but I would like to cut my query short.
$query = "SELECT item FROM database WHERE item_name = '$name' ORDER BY RAND() [dev.mysql.com] LIMIT 1";