SQL unexpected T_CONSTANT_ENCAPSED_STRING Error

SQL unexpected T_CONSTANT_ENCAPSED_STRING Error

am 22.03.2007 14:06:00 von Lasitha Alawatta

--0-1249798926-1174568760=:40297
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi All,

I have a sql script unable to execute. Because I need to insert double-coats ( " ) also to one field(SPParams field).

Ones I execuit this using mysql_query($sql), it gives "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING " error message.


$strSql = "";
$strSql = $strSql."UPDATE Masters.tblBranches SET FHeadMail= 'aind@abc.net;', ";
$strSql = $strSql."BranchDBConnection='Server=SLBC05; Database=BackOffice; UID=b0;pwd=sSLap.+05);', ";
$strSql = $strSql."SPParams='

CustomerName

CustomerType

' ";
$strSql = $strSql."WHERE BranchCode=101";

How can I be able to solve this issue..?


Thank you very much,
Lasitha


---------------------------------
What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship.
--0-1249798926-1174568760=:40297--

Re: SQL unexpected T_CONSTANT_ENCAPSED_STRING Error

am 22.03.2007 14:28:53 von Jean-Marc Guillermin

Hi Laitha,

And with backslashes before them ??

jm

----- Original Message -----
From: "Lasitha Alawatta"
To:
Sent: Thursday, March 22, 2007 2:06 PM
Subject: [PHP-DB] SQL unexpected T_CONSTANT_ENCAPSED_STRING Error


> Hi All,
>
> I have a sql script unable to execute. Because I need to insert
> double-coats ( " ) also to one field(SPParams field).
>
> Ones I execuit this using mysql_query($sql), it gives "Parse error: parse
> error, unexpected T_CONSTANT_ENCAPSED_STRING " error message.
>
>
> $strSql = "";
> $strSql = $strSql."UPDATE Masters.tblBranches SET FHeadMail=
> 'aind@abc.net;', ";
> $strSql = $strSql."BranchDBConnection='Server=SLBC05;
> Database=BackOffice; UID=b0;pwd=sSLap.+05);', ";
> $strSql = $strSql."SPParams='

> t="VarChar">CustomerName

> t="TinyInt">CustomerType

' ";
> $strSql = $strSql."WHERE BranchCode=101";
>
> How can I be able to solve this issue..?
>
>
> Thank you very much,
> Lasitha
>
>
> ---------------------------------
> What kind of emailer are you? Find out today - get a free analysis of your
> email personality. Take the quiz at the Yahoo! Mail Championship.

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