Hey there forum.
I guess to start off, I am trying to figure out what is the best way to handle MySQL connections.
I tried to create a class that would hanlde sql queries connections, and some other functions -- the class worked fine -- but when I tried to apply it to sessions and some of the few things that I thought I knew about PHP I didnt get what I expected.
I need to make several queries to the database, but I dont know if the most efficient way to do this is to keep a connection live and keep sending requests on the same sql connection during a session - or just simply connect and reconnect everytime I need to send a query.
Particularly I am having a problem keeping my sql object alive after post requests, .. but depending on the answer to the above question I might just drop the whole class idea altogether...
This code is pretty simple -- the functions associated with the sql class all do their assumed tasks -- however when I try to send a disconnect request via a form post I get an error:
[color=red]Warning: mysql_close(): no MYSQL-Link resource supplied in .. at line .. [/color]
This says to me that the linkup that was initially created isnt persisting for some reason (but the object's functions are still working.. how can this be? shouldnt the object be undefined too? hmm actually I dont know what the value os $sql->link is yet,.. ill go check that while your looking at this haha.. So anyway maybe you can see why Im asking.. what is the best way to manage an sql connection -- the code I derived based on the assumptions I made is not working..
[/code]