|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Help with my class
I have just recently started trying to use classes and one of the first scripts i made was a class to connect to a database. I have made a few scrpts now that rely on that script and I thought it was working fine but now i have found that it isnt working at all. actually i dont even think its doing anything. Can someone have a look and see if they can find anything wrong with what im doing or with teh class itself.
I use this code to initiate it. PHP Code:
PHP Code:
|
|
#2
|
|||
|
|||
|
PHP Code:
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
Thanks joe
|
|
#4
|
|||
|
|||
|
Lol - forgot to explain it.
I changed it around a little so you can define your connection params outside of the class - like in a require()'d file or something - makes it a little more transportable. Also, the error supression (@) will suppress any connection errors so they don't output to the screen - the errors in return will be send to the error method which will place them in a array. You can then use that array to see if any errors occured and adjust accordingly... |
|
#5
|
|||
|
|||
|
woa, this forum certainly ranks high as a support community
you guys are great! - also are PHP classes a good thing to learn for a PHP beginner (me) and if not wat is the next thing I shud learn? considering I dont know much... ![]()
__________________
You don't deserve to read my signature...yeah! That's it, keep walking...yeah walk away from me! That's it! Get out of my pub, you're barred! |
|
#6
|
|||
|
|||
|
Well - OO is a great thing to learn as OO in practice can be used in other languages also. As for beginers, the best thing would be to get a grip or feel on all the built in functions php has to offer, build applications with funtions first - then once you get the hang of functions, you will have te basics to creating methods in OO. Once you have the basics down and are able to be effecient, then it is time to step to the next level...
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Help with my class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|