Hi there

I'm just scraping the surface of MySQL and PHP and there's something I can't
work out. 

I want to get the first 64 characters from a database row result and display
only those 64 characters using PHP. The snipped code is here - I've deleted
all the error trapping and comments:

$result = @mysql_query("select ID, Writer, left(text,64) from Reports where
writer like '%kim%';");

while ($row = mysql_fetch_array($result)) {
$ID=$row["ID"]; 
$Writer=$row["Writer"];
$text= $row["Text"];

echo ("<p>" . $ID . " " . $Writer . " " . $Text . "</p>");

This returns a blank result for Text. If I remove the left() from the SQL it
works but displays the entire report - hundreds of words. How can I display
only those first 64 characters - am I missing something obvious?

Many thanks, kim


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

Reply via email to