<?php | |
function mysqlquery($query,$dbcon,$returnValue = false){ | |
$result = $dbcon->query($query); | |
if(!$result){ | |
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. | |
if($returnValue){ | |
return $result->fetch_assoc(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment