$sp0=mysql_query('SELECT `items_id` FROM `items_main_data` WHERE `data` LIKE "%art=%"');
$rnd0=array();
while($pl0=mysql_fetch_array($sp0)){
$rnd0[count($rnd0)]=$pl0['items_id'];
}
$rnd0['itm1']=$rnd0[rand(0,count($rnd0))];
$rnd0['itm2']=$rnd0[rand(0,count($rnd0))];
$rnd0['itm3']=$rnd0[rand(0,count($rnd0))];
$rnd0['itm1']=mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm1']).'" LIMIT 1'));
$rnd0['itm2']=mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm2']).'" LIMIT 1'));
$rnd0['itm3']=mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($rnd0['itm3']).'" LIMIT 1'));