This is the code I was using with mysql and now I am trying to convert all of my functions over to mysqli. How would I format this so that it returns the values I need?
return (mysql_result($query, 0) == 1) ? true : false;
This is the code I was using with mysql and now I am trying to convert all of my functions over to mysqli. How would I format this so that it returns the values I need?
return (mysql_result($query, 0) == 1) ? true : false;
mysqli has a main function "query" If it's CRUD SQL it will return 1 or 0 (success or not) if it's select SQL it will return the result
$sqli = new mysqli(DB_SERVER,
DB_USERNAME,
DB_PASSWORD,
DB_NAME);
$result = $sqli->query("INSERT INTO...");
return ($result == 1) ? true : false;