Skip to content

Instantly share code, notes, and snippets.

Last active Nov 28, 2016
What would you like to do?
function mysqlquery($query,$dbcon,$returnValue = false){
$result = $dbcon->query($query);
die('There was an error running the query [' . $dbcon->error . ']');
//Do not use `fetch_assoc()` in INSERT query to prevent
//`PHP Fatal error: Call to a member function fetch_assoc() on a non-object` error.
return $result->fetch_assoc();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment