possible in sql?
Posted: Sun Apr 09, 2006 10:59 pm
I use a query that looks like this to manipulate a database field
What this is doing is selecting the description field, stripping HTML out of it, and returning the first 100 characters in $description.
Instead of selecting the entire description field (which can be lengthy) and loading it into memory.. is it possible to do something similar to this in the SQL query?
Code: Select all
$result = mysql_query("SELECT `description` FROM `users` WHERE `id` = '{$array['id']}' LIMIT 1") or die(mysql_error());
$array = mysql_fetch_assoc($result);
$description = substr(strip_tags($array['description'],0,100));Instead of selecting the entire description field (which can be lengthy) and loading it into memory.. is it possible to do something similar to this in the SQL query?