1. extablish the mysql cocnnection (this you are doinfg properly)$db = new
2. Perfform an action on the database , again you did this properly but need to end the statement with the semi colon.
$stmnt=$conn->(query('select * from test01');
3. Check to see if you have results:
4. If you have results, do something with those results such as iterate through and echo a field or something.
if($stmnt->rowcount()>0)
{
while($row = $stmnt->fetch(PDO::FETCH_ASSOC))
{
do something.....;
}
Setting the connection to null really doesn't do anything for you imho. The connection will close at the end of the program.
.
__________________
All cookies cleared!
|