Database Documentations

Id Category Code Examples Test Code Links Remarks

View
Sampe Code 
<?php

$dbhost = 'localhost';
$user = 'root';
$pass = 'passwd';
$dbname = 'mydb';

try {
    $dbh = new PDO("mysql:host=localhost;dbname=mydb", $user, $pass);

    $sql = explode(';', file_get_contents('./final.sql'));
    $n = 0;
    foreach ($sql as $row) {
       $query = $row;
       echo $query;
       $dbh->query($query);
       $n++;
       print "$n\n";
    }
    $dbh = null;
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "
"; die(); } ?>
 
     

View
Replace 
How to Find & Replace Data in MySQL
 
To find a string in a certain field and replace it with another string:
 
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');
 
     

View
Useful Links 
MySql Home
 
  http://www.mysql.com/   

Page 1 of 1, showing 3 records out of 3 total, starting on record 1, ending on 3

<< previous | | next >>

Actions