Su un libro che sto leggendo l'autore scrive che secondo lui il modo giusto per accedere ai database Mysql è usando la libreria PEAR.
ecco l'esempio:
Codice PHP:
<?php
require_once("DB.php");
$dsn = 'Mysql://root:password@localhost/books';
$db =& DB::Connect ($dsn, array() );
if (PEAR::isError($db)) { die($db->getMessage()); }
$sth = db->prepare( "INSERT INTO author VALUES (null, ?)" );
$db->execute( $sth, array ($_POST['name'] ) );
?>
Voi come trattare l'accesso al DB?
Usate Pear o altri metodi?
dove lo mettete? file che includete ogni volta? classi? :master: :master: