Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2005
    Thanked 0 Times in 0 Posts

    Efficiency and speed question

    I was wondering which is better in terms of speed out of the two following scenarios.

    Submitting a mysql query with string manipulation functions built in


    Getting raw data and using php string functions to manipulate the returned data

    Also as a supplementary point of interest are there always efficiency advantages from one scenario or the other or does it very much depend on the nature of data manipulation you are doing?

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Thanked 58 Times in 54 Posts
    This all depends on the situation.

    Efficiency wise, I don't think there will be much difference between either.

    If you do the changes in the SQL, you're putting strain on the database.

    If you do it in PHP, you're putting strain on PHP.

    Either way, the server is strained. Where can you spend the resources, which one of them is loaded the most?

    Both PHP and MySQL are optimized to work with text, so you won't see much of a difference. In my opinion, a database is there to store data and retrieve it. Not manipulate it. But that's personal preference.

    The difference would highly depend on what you're considering.


    Posting Permissions

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