Syntax Question

This is a discussion on Syntax Question within the PHP General forums, part of the PHP Programming Forums category; Hi, I am using an include with a very simple select statement: $sel = "SELECT type_name FROM customer_types WHERE type_id = &...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-10-2008
Mtek
 
Posts: n/a
Default Syntax Question

Hi,

I am using an include with a very simple select statement:

$sel = "SELECT type_name FROM customer_types WHERE type_id = ".
$row['customer_type'].\"";
$customer_text = mysql_result(mysql_query($sel),0 ,0);


That is my select statement. I am seeing this error:

PHP Warning: Unexpected character in input: '\\' (ASCII=92) state=1
on line 3

Can someone tell me what is wrong? I need to escape that last double
quote.......

Thanks!
Reply With Quote
  #2 (permalink)  
Old 05-11-2008
campionedelmonde2006@googlemail.com
 
Posts: n/a
Default Re: Syntax Question

On May 10, 6:20*am, Mtek <m...@mtekusa.com> wrote:
> Hi,
>
> I am using an include with a very simple select statement:
>
> $sel = "SELECT type_name FROM customer_types WHERE type_id = ".
> $row['customer_type'].\"";
> $customer_text = *mysql_result(mysql_query($sel),0 ,0);
>
> That is my select statement. * I am seeing this error:
>
> *PHP Warning: *Unexpected character in input: *'\\' (ASCII=92) state=1
> on line 3
>
> Can someone tell me what is wrong? *I need to escape that last double
> quote.......
>
> Thanks!


Try

"SELECT type_name FROM customer_types WHERE type_id =
"{$row[customer_type]}";
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0