[thelist] php mysql update problem
christopher at ideadesigners.com
christopher at ideadesigners.com
Fri Jun 27 07:01:18 CDT 2003
[resent because I'm a dope and didn't include the subject the first time. :) ]
Austin Harris wrote:
> // do the update before getting records.
> if ($_POST['submit']=='Submit') {
> // do the update
> $update_sql = "UPDATE jayandmel SET Present='2' WHERE Present='House'";
> my_debug("SQL -- $update_sql");
> }
>
> // carry on and grab the required records as normal.
Hi Austin,
You need to run the SQL statement after you have constructed it inside
variable $update_sql.
Your debug statement outputs the SQL but you don't actually use it on
your DB to do the update :)
ADD:
> $update_sql = "UPDATE jayandmel SET Present='2' WHERE
Present='House'";
$result = mysql_query($update_sql);
> my_debug("SQL -- $update_sql");
then debug on:
my_debug("result -- $result SQL -- $update_sql");
to give you the status of the result......although you should see the
table contents change.
--
Chris
-------------------
[Internet]
http://www.ideadesigners.com [iseries & web technologies]
mailto: christopher at ideadesigners.com
[Telephone]
mobile: +44 7966 003860
Office: +44 1494 731814 ext. 832
Direct: +44 1494 731832
[Instant Message]
ICQ: 78019724
YIM = Josephc_98
MSN = christopher at ideadesigners.com
More information about the thelist
mailing list