Hey Everyone!
I have a question about oop. I am trying to write a MySQL class for managing my MySQL db's and calls. So far I have almost completed it, but I am missing lots of functions. These are the result functions (ie. mysql_fetch_array() or mysql_num_rows() etc.). Instead of creating a function in my class to handle each of these I would like to be able to call my class like $mysql->fetch_array($result)
and have that translate to mysql_fetch_array() within my class. The only way I see of doing this would be to create a function that handles invalid function calls for my class. Then using an if statement, see if the invalid function call was to a mysql function and then send it to that. Does this sound possible. If not, might there be another way to do this?
Thanks,
FlashCreations
FlashCreations
20
Posting Whiz
Recommended Answers
Jump to PostWhat you're describing sounds like you're looking for something like the __call() magic method
All 3 Replies
mschroeder
251
Bestower of Knowledge
Team Colleague
FlashCreations
20
Posting Whiz
mschroeder
251
Bestower of Knowledge
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.