Printing mysql_error
This is a code snipped to print mysql error.
If there is no error mysql_error returns null, thus if evaluates false and there is no output.
If there is error previous mysql_query statement, if evaluates true. Since $my_sql_error is populated here, we can use inside of the if. $sSQL is sql query in error.
if($my_sql_error = mysql_error()){
echo $sSQL. "". $my_sql_error;
}
This kind of snipped if fits in a print_mysql_funciton may be much more usefull. But it were some kind of logging facility yemede yanında yat.
Similar
New technique to win olimpics
At the 1968 Olympics, Dick Fosbury took the athletics world by surprise with an unusual high-jump technique.
Printing mysql_error
This is a code snipped to print mysql error.
If there is no error mysql_error returns null, thus if evaluates false and there is no output.
multiple ON DUPLICATE KEY UPDATE
Here is an example of how to update multiple columns using values supplied in the INSERT statement. This assumes that column 'a' is the unique key.
multiple ON DUPLICATE KEY UPDATE
Here is an example of how to update multiple columns using values supplied in the INSERT statement. This assumes that column 'a' is the unique key.
php unlink recursive
The shortest recursive delete possible.
<?php
/**
* Delete a file or recursively delete a directory
*
* @param string $str Path to file or directory
*/


Comments
Post new comment