Category: Mysql

Hosting Mysql PHP Webmastering

Automatic Database and file Backup with PHP

phpMyBackup Pro is a very easy to use, free, web-based MySQL backup application, licensed under the GNU GPL. You can create scheduled backups, manage and restore them, download or email them and a lot more! Major features: – backup of one or several databases with or without data, table structure, … – three types of […]

Mysql

MySQL Data Types Digest

Type Storage Minimum Value Maximum Value (Bytes) (Signed/Unsigned) Signed/Unsigned) TINYINT 1 -128 127 0 255 SMALLINT 2 -32768 32767 0 65535 MEDIUMINT 3 -8388608 8388607 0 16777215 INT 4 -2147483648 2147483647 0 4294967295 BIGINT 8 -9223372036854775808 9223372036854775807 0 18446744073709551615 The CHAR and VARCHAR types are similar, but differ in the way they are stored and […]

Mysql

Mysql Get Query Digest

require(constant(“sec_inc”).’/config.php’); $link=mysql_connect($host,$user,$pass); mysql_select_db($dbname); Fetch: $query = “select * from table_name where field='”.$var.”‘”;//Don’t forget escaping… mysql_query(“SET NAMES ‘utf8′”, $link); $result=mysql_query($query); while($row=mysql_fetch_assoc($result)) { //Bla Bla Bla }   Count: $query = “select count(*) from table_name where field='”.$var.”‘”;//Don’t forget escaping… $row=mysql_fetch_row($result); $count = $row[0];  

Mysql

Mysql Set Query Digest

Replace: UPDATE tablename SET tablefield = replace(tablefield,”findstring”,”replacestring”); UPDATE tablename SET column1 = “text1″ WHERE¬† column2 =”text2”;