php - Prepared statement & binding the results to array -


i'm trying fetch rows database , put them array can't work out!

so fetch data so:

if ($archiveinfo = $mysqli->prepare('select date,title blog')) {   $archiveinfo->execute();   $archiveinfo->close(); } 

but not sure best code bind results array. i'm guessing 2 dimensional array i.e. $archiveinfo[0]['date']

how bind array , start echoing selected sections of array?

if ($archiveinfo = $mysqli->prepare('select date,title blog')) {   $archiveinfo->execute();     $archiveinfo->bind_result($date, $title);      /* fetch values */     while ($archiveinfo->fetch()) {         echo $date." ".$title;     }    $archiveinfo->close(); } 

you use http://php.net/manual/en/mysqli-result.fetch-array.php instead , loop through array..


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -