All pastes #746624 Raw Edit

Mine

public text v1 · immutable
·published 2007-10-23 11:23 UTC
rendered paste body
$id = uniqid();
mysql_query('create table tmp'.$id.' like poneyetalon');
mysql_query("insert into tmp".$id." ( id , nom , type , jour , sexe , couleur_corps , couleur_yeux , couleur_criniere , saillie , sabot , criniere , tatouage , marquage , fond , devant , accessoire , mariage , marie , pseudo, action ) select poney.id , poney.nom , poney.type , poney.jour , poney.sexe , poney.couleur_corps , poney.couleur_yeux , poney.couleur_criniere , poney.saillie , poney.sabot , poney.criniere , poney.tatouage , poney.marquage , poney.fond , poney.devant , poney.accessoire , poney.mariage , poney.marie , pseudo, action from poney left join joueur on (jid = joueur.id) where action > ".(time()-2*24*60*60)."  and etalon = 1 and poney.sexe = 1");
mysql_query("DROP TABLE IF EXISTS tmp2");
mysql_query("RENAME TABLE poneyetalon TO tmp2, tmp".$id." TO poneyetalon");
mysql_query("DROP TABLE IF EXISTS tmp2");


			$sql = 'select poney.*, pseudo from poney left join joueur on (jid = joueur.id) where action > '.(time()-2*24*60*60).'  and etalon = 1 and poney.sexe = 1 '.$_SESSION['recherche'].' order by action desc limit '.($_GET['page']*ETALON_PAR_PAGE).', '.ETALON_PAR_PAGE;
			
			//$sql = 'select * from poneyetalon where 1 '.str_replace('poney.','', str_replace('joueur.','', $_SESSION['recherche'])).'  order by action desc limit  '.($_GET['page']*ETALON_PAR_PAGE).', '.ETALON_PAR_PAGE;