Results 1 to 5 of 5

Thread: best way to execute SQL?

  1. #1
    Join Date
    May 2006

    best way to execute SQL?

    I've read several php books and I've run across multiple ways of executing SQL for a MySQL database. What should I use? Do I have to use PEAR? Is PEAR better just because its written in C? Why do you not close a mysql_pconnect connection?
    I guess I'm completely confused. please someone tell me the best code

  2. #2
    Join Date
    Feb 2006
    Where I live, people get shot. I need to move.
    Theirs NO best way, its what way suits your needs, programming requirements, style, etc.

    Another way of putting it is its your choice.
    If life gives you a hard knock once in a while, your lucky. All I keep getting is a savage beating... everyday!
    AJAX! - Javascript Sha1 & MD5 - ASCII tables - Zend DevZone - My Space
    Stop Badware - Create "TEXT FILE" in Javascript - . - wikipedia on PHP -

  3. #3
    Join Date
    Aug 2005
    The Garden State
    most libraries for PHP are written in C.

    path to follow would be dependent on your overall development style. most, if not all, companies want object oriented development, and in this case if you are going to be using MySQL, you should use the MySQLi API with a MySQL server > 4.1.

    If you develop in a object oriented way, I would recommend a completely separate layer for database access, and have other items access that only. Will using a pconnect improve your site? probably not. it's more costly.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  4. #4
    Join Date
    May 2006
    thank you for your advise. I guess I'll then stick to what I have been using for now.

  5. #5
    Join Date
    Aug 2004
    Another consideration is portability, in that the mysqli_* functions are only available in PHP5. Therefore, if your software needs to be compatible with PHP4, then you'll need to stick with the mysql_* functions.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center