Article From:https://segmentfault.com/q/1010000012153466
Question:


False Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result, string given in

Answer 0:

mysql_fetch_array()The first parameter ismysql_queryThe results that have been queried.
Look at the document.

<?php
$con = mysql_connect("localhost", "hello", "321");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

$db_selected = mysql_select_db("test_db",$con);
$sql = "SELECT * from Person WHERE Lastname='Adams'";
$result = mysql_query($sql,$con);
print_r(mysql_fetch_array($result));

mysql_close($con);
?>

Leave a Reply

Your email address will not be published. Required fields are marked *