UtamaBeritaTutorialBlogTool


Category: MySQL

Backup MySQL database with AutoMySQLBackup

Posted By: zainal on March, 31 2007

AutoMySQLBackup can backup a single database or multiple databases on the server. Each database is saved in a separate file that can be compressed into gzip or bzip2.

The installation is very simple. Just download the one file bash script and save it somewhere, customize it to fit your setup, make it executable (chmod 777) and put it in cron.


No Comment | Category: MySQL

What caused an error in mysql query?

Posted By: zainal on February, 08 2007

$query = mysql_query("SELECT * FROM table WHERE table_id = 1", $db);
$content = mysql_fetch_object($query);

The above command will execute the query using the mysql_query(). $query will be true if the query is successfully executed or it will return false. But if the error occured, it just show the arguement is not a valid MySQL result. Use the mysql_error() function to find out what is the real error was:

$query = mysql_query("SELECT * FROM table WHERE table_id = 1", $db)
or die (”Query failed: ” . mysql_error() . ” Actual query: ” . $query);
$content = mysql_fetch_object($query);


No Comment | Category: MySQL