how can i change mysql code to pdo and store results in variabel
i use this code in index.php content:
$games_sql = mysql_query("SELECT id,col1,col2,now FROM tblname ORDER BY now ASC LIMIT 9");
$gn=0;
while($game_get=mysql_fetch_array($games_sql))
{
$id = $game_get['id'];
$col1= $game_get['col1'];
$col2= $game_get['col2'];
$now = $game_get['now'];
$gametimeanddate = jdate("l d M y time G:i",$now);
$gamedate = jdate("l d M y",$now);
$gametime = jdate("G:i",$now);
$gn++;
if(($gn%2)==0){
$class='background-color:#EEE'; , ..... ?>
and use this variables:
<?php echo $id;?>&title=<?php echo func1($col1).'-'.func1($col2);?>
and pdo connection include content:
$conn = new PDO('mysql:host=localhost;dbname
i want change my query to pdo and store query result to variables and use that in php codes