Hello Adrian,

Friday, June 08, 2001, 8:59:51 AM, you wrote:

ADC> Hi,

ADC> I am not sure whether this relates to this list or the (not working) php
ADC> list.

ADC> For simplicity:  I have a form that displays data from a table.  I will
ADC> take just one field that displays a name
ADC> <input type="text" name="name" value="<? echo $row[name];?>">

ADC> This allow a user to update the changes when the submit button is pressed.

ADC> On the next php file I do the following:

ADC> $tname =urldecode($name);
ADC> $tname1 = stripslashes($tname1);
ADC> $updtStmt = "update vusers set orgname='$tname1' where id=$tid";

Why do you use urldecode($name) and stripslashes($tname1)? What for?
Why didn't you try code like this:
$tname = AddSlashes($name);
$updtStmt = "update vusers set orgname='$tname' where id=$tid";

If $name contains "Adrian D'Costa", $updtStmt will contain
"update vusers set orgname='Adrian D\'Costa' where id=$tid"
and the query will be ok. 100% guarantee.

ADC> This works fine, but suppose in by table I have a name "Adrian D'Costa"

ADC> This starts all the problems.  I copy the sql statement from the php file
ADC> and try:

ADC> update vusers set name='Adrian D'Costa' where id=3;
ADC>     '>                

I get the '>> prompt that is waiting for me the close the '.  If I try the
ADC> same statement in mysql command line:

ADC>  update vusers set name="Adrian D'Costa" where id=3; Query OK, 0 rows
ADC> affected (0.01 sec)
ADC> Rows matched: 1  Changed: 0  Warnings: 0 

ADC> It works.  How do I do the same in php?  

ADC> TIA

ADC> Adrian


ADC> ---------------------------------------------------------------------
ADC> Before posting, please check:
ADC>    http://www.mysql.com/manual.php   (the manual)
ADC>    http://lists.mysql.com/           (the list archive)

ADC> To request this thread, e-mail <[EMAIL PROTECTED]>
ADC> To unsubscribe, e-mail <[EMAIL PROTECTED]>
ADC> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-- 
Best regards,
 Olexandr                            mailto:[EMAIL PROTECTED]
    

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to