php - MSQL to MYSQLI converter -
this question has answer here:
- changing mysql mysqli? [closed] 2 answers
i'm not familiar mysqli
<?php $bestaat = mysql_query("select * badgesdownload limit 7"); while($bestaat2 = mysql_fetch_array($bestaat)) { $bestaat3 = $bestaat2['naam']; $txt = mysql_query("select * badgesdownload naam = '".$bestaat3."'"); while($txt2 = mysql_fetch_array($txt)){ $txt3 = $txt2['txt']; echo $bestaat3; echo'<br>'; echo $txt3; echo'<br>'; } } ?>
how can change script mysqli?
mysqli - procedural method similar. add database connection first parameter query, , 'i' in functions...
$bestaat = mysqli_query($db, "select * badgesdownload limit 7"); while($bestaat2 = mysqli_fetch_array($bestaat)) { $bestaat3 = $bestaat2['naam']; $txt = mysqli_query($db, "select * badgesdownload naam = '$bestaat3'"); while($txt2 = mysqli_fetch_array($txt)){ echo $bestaat3.'<br>'.$txt2['txt'].'<br>'; } }
i have fixed obvious errors.. ..missing close braces main one.
Comments
Post a Comment