php - Prepared Statement - Mysql query result fetched into the array -
i implementing prepared statement fetching query result array seems wrong in fetch array line.
<?php $cat_id = intval($_get['cat_id']); include '../sys/conn.php'; if($category= $conn->prepare(" select t.term_id, t.name, t.slug, tm.term_id, tm.name, count(tr.object_id) total_products mg_terms t join mg_term_taxonomy tx on tx.term_id = t.term_id left join mg_term_relationships tr on tr.term_taxonomy_id=tx.term_taxonomy_id left join mg_terms tm on tm.term_id = tx.parent t.term_id=? group t.term_id")) { $category->bind_param('i', $cat_id); $category->execute(); $category->bind_result($cat_id, $cat_name, $cat_slug, $par_id, $par_name, $count); $category->fetch(); $array = $category->fetch_array(mysql_num); //line error $category->close(); }
the error have is:
fatal error: call undefined method mysqli_stmt::fetch_array()
any idea?
you have learn php oop.. , whatever need in simple way.. please click following link.
https://code.tutsplus.com/tutorials/object-oriented-php-for-beginners--net-12762
wiki
Comments
Post a Comment