Thread: [SOLVED] Random Id From table
View Single Post
  #1 (permalink)  
Old 11-19-09, 05:12 PM
smithygotlost smithygotlost is offline
Aspiring Coder
 
Join Date: Jul 2006
Location: United Kingdom
Posts: 413
Thanks: 12
Thanked 3 Times in 3 Posts
Random Id From table

Heya guys

ok i have a table in my db called room under the table i have roomid and z the roomid can be anything from 1 - 1000 but the z will be the same if its the same area. now what i wanna do is select from roomid where id=300 that will then give the z from that table in this case 3

so right now i have z=3 ,what i now wanna do is get all the roomid's where z=3 and choose a random one, and display it as a variable

How can i do that ?

Cheers
Mike