The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

most things you do on your website that involve your database can mainly be done with PHP functions.

except for those things which require sending a lot of data to the php client and then using only some of it

like returning only the latest entry in a blog (instead of all entries), computing the number of entries in each category (instead of counting them with SQL), sending an entire TEXT column value when you only want the first 20 words, etc.

except for those things which require sending a lot of data to the php client and then using only some of it

like returning only the latest entry in a blog (instead of all entries), computing the number of entries in each category (instead of counting them with SQL), sending an entire TEXT column value when you only want the first 20 words, etc.

Of course, but he was asking for an SQL command to do things that PHP can already do, that way if he uses substr, if he wants to do it on the same query more than once, he doesn't have to use multiple queries