View Single Post
Old 04-15-2022, 01:13 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,075
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!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote