I have a table called bodyname with the below structure: Action_Name,Content --------------------- Records (info shown is just for sample): a,asdasdad a,3242343244 v,asdsadsadasd v,a444443534535 c,asdasdsadasda c,6y445y45y45y4 with a single query I would like to pull a random A, V and C I have this, but it pulls the same info and just randomizes the order the returned data is in select action_name,content from bodyname group by action_name order by rand()
You can pull three rows with one query, and then use your code to access one variable from each of the 1st, 2nd, and 3rd rows (which are all randomly selected).