title: Converting from mysql to mysqli (mysql_fetch_array)
body: <p>I have some php code that was like this: </p>
  
  <pre><code>$row = mysql_fetch_array ( mysql_query("SELECT * FROM `tblFacilityHrs` WHERE `uid` = '$uid'")); 
  </code></pre>
  
  <p>I'm now trying to convert it to <code>mysqli_fetch_array</code> as shown here <a href="http://php.net/manual/en/mysqli-result.fetch-array.php" rel="nofollow">http://php.net/manual/en/mysqli-result.fetch-array.php</a> (Example #1 Object oriented style)</p>
  
  <p>I'm not sure what the example means by "$result". </p>
  
  <p>This is what I've converted my code to so far:</p>
  
  <pre><code>&lt;?php 
  include('../config.php'); 
  if (isset($_GET['uid']) ) { 
  $uid = $_GET['uid'];
  $id = $_GET['id'];  
  if (isset($_POST['submitted'])) { 
  foreach($_POST AS $key =&gt; $value) { $_POST[$key] = mysqli_real_escape_string($value); } 
  
  //Query for tblFacilityHrs
  $sql = " UPDATE tblFacilityHrs SET `title`='{$_POST['title']}',`description`='{$_POST['description']}' WHERE `uid` = '$uid' "; 
  $result = $mysqli-&gt;query($sql) or die($mysqli-&gt;error);
  
  //Query for tblFacilityHrsDateTimes
  $sql2 = "UPDATE tblFacilityHrsDateTimes SET `startEventDate`='{$_POST['startEventDate']}',`endEventDate`='{$_POST['endEventDate']}', `startTime`='{$_POST['startTime']}',`endTime`='{$_POST['endTime']}',`days`='{$_POST['days']}',`recurrence`='{$_POST['recurrence']},`finalDate`='{$_POST['finalDate']}' WHERE `id` = '$id' "; print $sql2;
  $result2 = $mysqli-&gt;query($sql2) or die($mysqli-&gt;error);
  
  echo ($mysqli-&gt;affected_rows) ? "Edited row.&lt;br /&gt;" : "Nothing changed. &lt;br /&gt;"; 
  echo "&lt;a href='list.php'&gt;Back&lt;/a&gt;";
  } 
  $row = $result-&gt;fetch_array($mysqli-&gt;query("SELECT * FROM `tblFacilityHrs` WHERE `uid` = '$uid'"));
  $row2 = $result2-&gt;fetch_array($mysqli-&gt;query("SELECT * FROM `tblFacilityHrsDateTimes` WHERE `id` = '$id'"));
  ?&gt;
  </code></pre>
  
  <p>There is probably a lot wrong with as I am learning mysqli, but right now it errors on </p>
  
  <blockquote>
    <p>Fatal error: Call to a member function fetch_array()</p>
  </blockquote>