mysql_fetch_array and extract() with LEFT SELECT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm having a problem when I use mysql_fetch_array and extract() following a
left select query. As an example...

$query = "SELECT id,LEFT(fluff,80) FROM sometable";
$result = mysql_query($query) or die('message');

while ($row = mysql_fetch_array($result){
extract($row);
echo "<P>" . $id . ": " . $fluff . "</P>";
}

would echo the $id, but there would be nothing for $fluff. However, if I
select only 'fluff' from the MySQL table, I get the full text for $fluff. I
am reluctant to SELECT the entire fluff text from the table and shorten it
in PHP  as that seems inefficient to me - (but correct me if I am wrong).

I expect the solution must be dead easy, but I can't find it or figure it
out.

Many thanks,

Jeffrey

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux