note 31439 rejected from function.substr by spic
| From: | spic@php.net | Date: | Tue, 22 Apr 2003 07:19:44 +0000 |
| Subject: | note 31439 rejected from function.substr by spic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-46921@lists.php.net to get a copy of this message | ||
i'm trying to get the first and last word of a field...
so for the first word i did,
$sql = "select SUBSTRING_INDEX(field, ' ', n) FROM tablename" ;
$first = query($sql);
and for the last one
$sql = "select SUBSTRING_INDEX(field, ' ', -n) FROM tablename";
$last = query($sql);
so far so good...
but when i try to print the values of $first and $last
like print($first[0]);
all i get is "Array" :p
any idea?