php - MSQL to MYSQLI converter -


this question has answer here:

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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -