Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PHP
function getSettingsPart($id, $part, $mycon)
{		
  connect_to_maindb();
  
  $part = chop($part);
  $query = "SELECT * FROM om_settings WHERE id = '$id' ";	
  $result = mysqli_query('mysqli $mycon', 'string $query',[ 'int $id = MYSQLI_STORE_RESULT']) or die (mysqli_error($query));
  $count = mysqli_num_rows($query);
  $row = mysqli_fetch_assoc($query);
  
  if($count == 1)
  {
    $content = $row[$part];
    return $content;
  }
  else
  {
    return FALSE;
  }
}


Warning: mysqli_query() expects parameter 1 to be mysqli, string given in B:\Program Files (x86)\EasyPHP\php\EasyPHP-DevServer-14.1VC11\data\localweb\GP1Public\functions\general_functions.php on line 70

Warning: mysqli_error() expects parameter 1 to be mysqli, string given in B:\Program Files (x86)\EasyPHP\php\EasyPHP-DevServer-14.1VC11\data\localweb\GP1Public\functions\general_functions.php on line 70
Posted
Updated 11-Feb-14 7:46am
v2

Suppose that $mycon is a connection object of type mysqli...
PHP
$result = mysqli_query($mycon, $query) or die (mysqli_error($mycon));


It seems that you copied the description from the PHP mysqli help site, without understanding what you done!!!
It is very advised to learn before to code!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900