Re: mysql update not working
| From: | David Robley | Date: | Thu, 26 Jun 2003 12:55:44 +0000 |
| Subject: | Re: mysql update not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152976@lists.php.net to get a copy of this message | ||
In article <3EFA0E3E.10909@goquest.com>, steve@goquest.com says...
> I have the following code:
>
>
> $sql = "UPDATE class_sub SET desc = '$catdesc', sub_cat =
> '$subcatname'
> WHERE id='$catid'";
> echo $sql;
> $sql_result = mysql_query($sql);
> if (!$sql_result)
> {
> echo "<P>Couldn't update record!<br></p>";
> echo mysql_error();
> exit;
> } else
> {
> header("Location: index.php"); /* Redirect browser */
> exit;
> }
> here is the actual sql statement:
> UPDATE class_sub SET desc = 'Come play with us! This class is designed
> to challenge your cardiovascular and muscular endurance. Participants
> will work or \"play\" in different activities such as team exercises,
> sprints, obstacle courses, cycling, plyometrics, and core conditioning.
> Challenge yourself like never before!', sub_cat = 'Recess' WHERE
> id='4'
>
> And the error:
>
>
> Couldn't update record!
>
> You have an error in your SQL syntax near 'desc = 'Come play with us!
> This class is designed to challenge your cardiovascul' at line 1
Desc is a reserved word in mysql
--
Quod subigo farinam
$email =~ s/oz$/au/o;