954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Creating PHP functions contain MYSQL functions

I have been reading books and articles and I have seen various mysql functions (mysql_query, etc) being used inside php functions and those php functions be called everything the php programming requires a query, etc.

So what do you think are the best practices, etc?

Thanks, Regards X

PS: I have tried to get this going and queries are fine but fetch_assoc has been giving me problems

OmniX
Practically a Master Poster
656 posts since Dec 2007
Reputation Points: 31
Solved Threads: 10
 

You can use directly mysql_* functions or use an abstraction layer such as ADODb or a framework like CakePHP that exposes the database as objects.

filippo.toso
Newbie Poster
9 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

thats what I use now but I thought it be more productive if I used functions to state my mysql_*.

Can anyone give a working example of a working function using mysql_*s?

Thanks, Regards X

OmniX
Practically a Master Poster
656 posts since Dec 2007
Reputation Points: 31
Solved Threads: 10
 

Umm.. OmniX, isn't this problem solved yet ?

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You