on 4/11/01 7:48 PM, Mike Baerwolf at [EMAIL PROTECTED] wrote:

> SELECT substring_index( body, ".  ", 2) FROM news;
> 
> This works great from the mysql client but when I try it using php with
> this:
> 
> $result = mysql_query("SELECT substring_index(body, "." ,2) FROM news"

The way you have this written, PHP is using the . for concatenation.  To fix
the problem you need to alternate or escape the quotes, i.e. :

$result = mysql_query("SELECT substring_index(body, \".\" ,2) FROM news"

or

$result = mysql_query('SELECT substring_index(body, "." ,2) FROM news'

or

$result = mysql_query("SELECT substring_index(body, '.' ,2) FROM news"

Hope that helps,

Paul Burney
http://paulburney.com/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to