city_coder
02-07-2010, 12:07 PM
Hi guys
im currently stood opposite a brick wall banging my head against it with this.
Iv been trying to learn the OOP way to connect to my db. Its finally got to me that i need to learn it rather than do procedural & its starting to cause me more pain than i think its worth.
Iv been looking around the web for days & trying loads of different tutorials on how to connect to my db & query it. So far iv found classes that are amazingly complex but then dont tell you how to use it, scripts that just dont work & some in the middle that just dont seem to work for me.
If anyone can just show a basic example of how to connect, close & a simple method (function, whatever you want to call it) that queries the db & the code for retrieving the query results, then i would be extremely happy!
I am one of these guys that learns by getting an example working & picking at it & changing it to suit me, then i become more confident & can start to write my own.
Cheers in advance guys.
im currently stood opposite a brick wall banging my head against it with this.
Iv been trying to learn the OOP way to connect to my db. Its finally got to me that i need to learn it rather than do procedural & its starting to cause me more pain than i think its worth.
Iv been looking around the web for days & trying loads of different tutorials on how to connect to my db & query it. So far iv found classes that are amazingly complex but then dont tell you how to use it, scripts that just dont work & some in the middle that just dont seem to work for me.
If anyone can just show a basic example of how to connect, close & a simple method (function, whatever you want to call it) that queries the db & the code for retrieving the query results, then i would be extremely happy!
I am one of these guys that learns by getting an example working & picking at it & changing it to suit me, then i become more confident & can start to write my own.
Cheers in advance guys.