Re: Table contents not updated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wikus Moller wrote:
Hi.

I am new to uising html forms with php and I am having a problem with
database contents not being updated although it seems my coding is
correct.

Is it getting into the function? What is the exact database query that is being run? Does that return an error when you run it manually?


$adds=mysql_query("UPDATE sub_sites SET
sitename='".$snm."', sitelink='".$lnk."', sitelogo='".$image."',
catid='".$catg."', uid='".$uid."', dscr='".$dsc."',
keywords='".$keywords."', weblink='".$weblnk."' WHERE id='".$sid."'");

You're not doing any escaping here, so a quote or something like that could be causing the problem. I'd suggest using mysql_real_escape_string or mysql_escape_string depending on what version of php you are running (see manual for more info).

$update_query = "UPDATE sub_sites SET
sitename='".mysql_real_escape_string($snm)."', sitelink='".mysql_real_escape_string($lnk) ..............

echo $update_query;

$adds = mysql_query($update_query);

--
Postgresql & php tutorials
http://www.designmagick.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux