Wednesday, 15 May 2013

php - Mysqli - Bind results to an Array -



php - Mysqli - Bind results to an Array -

i switched mysqli mysql , started using prepared statements. in mysql do

$result = mysql_query("select * table id = ?");

so array of whole table in 1 variable.

but in mysqli do

mysqli_stmt_bind_result($stmt, $result);

so here 1 variable gets bind variable result. how can same variable(array) got mysql? ps - hope ques clear enough. know not many methods possible luking best one. pss - more comfortable procedural way.

use this

$con=mysqli_connect( "$host", "$mysql_u", "$mysql_p","$mysql_db");/*these variables ur host,username, password , db name*/ $val="select * table"; $ex=mysqli_query($con,$val); while ($row = mysqli_fetch_assoc($ex)) { $ans=$row['col1']; .... }

php mysql arrays mysqli bind

No comments:

Post a Comment