Is there anything returned from MySQL/PHP on a INSERT query being executed? Here is my function which I have in a CLASS.
function mysqlQuery($query) {
// Gets the results from the query
$results = mysql_query($query, $this->connection);
// Loops through the queried results as an multi-dimensional array
while($rows = mysql_fetch_array($results, MYSQL_ASSOC)) {
// Push results to single array
$rs[] = $rows;
}
// Return results as array
return $rs;
}
This is how I call the function
$rs = $dbh->mysqlQuery($query);
But executing a INSERT query the $rs returns nothing. Does my function need help or is this the default behavior? Any tips would be helpful as well.
DUH, thanks for reminding me that it returns TRUE/FALSE. for some reason I had it in my head it actually returned another value, but after looking at my function I see I'm not checking for the TRUE/FALSE condition and only looping through the results array.
Thanks for all the correct answers but first to answer correctly got the points, cheers!