<?php
function BeginQuery()
{
$dbh = new PDO('mysql:dbname=test;host=localhost','','');
return $dbh;
}
?>
Then later on you could use something liek
$q = BeginQuery();
$query = "INSERT INTO testing(name)VALUES('hi');";
$q->exec($query);
Is this acceptable to do this? Is there anything bad about this?

New Topic/Question
Reply



MultiQuote





|