Latest Tutorial

<?php

// configuration

$dbhost        = "localhost";
$dbname        = "pdo";
$dbuser        = "root";
$dbpass        = "";
// database connection
$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);

// new data
$title = 'PHP Pattern';
$author = 'Imanda';
$id = 3;

// query
$sql = "UPDATE books SET title=?, author=? WHERE id=?";
$q = $conn->prepare($sql);
$q->execute(array($title,$author,$id));

?>

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top
Blogger Template