Re: [PHP-DB] PHP and MYSQL Update problem

[email protected] (Manu Gupta)
Newsgroups php.db
Message-ID <[email protected]>
try ..
$q = addslashes("UPDATE episodes SET episode_title = '$_POST[episode_title]'
,
episode_scheduleddate = ".strtotime($_POST['episode_scheduleddate'])."
, episode_description = '$_POST[episode_description]' WHERE episode_id
= $_POST[episode_id]");

or try

$q = "UPDATE episodes SET episode_title = '{$_POST[episode_title]}' ,
episode_scheduleddate = "{.strtotime($_POST['episode_scheduleddate'])}."
, episode_description = '{$_POST[episode_description]}' WHERE episode_id
= {$_POST[episode_id]}";

On Tue, Jan 26, 2010 at 10:51 PM, Simone Fornara
<[email protected]>wrote:

> Hello,
> I have a little problem with a sql command string
>
> $q = "UPDATE episodes SET episode_title = '$_POST[episode_title]' ,
> episode_scheduleddate = ".strtotime($_POST['episode_scheduleddate'])."
> , episode_description = '$_POST[episode_description]' WHERE episode_id
> = $_POST[episode_id]";
>
> I keep getting this error
>
> You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near ''
>
> which doesn't help a lot. I've already tried to print the result
>
> UPDATE episodes SET episode_title = 'Title test 1 edited 2' ,
> episode_scheduleddate = 1232427600 , episode_description =
> 'Description test edited' WHERE episode_id = 1
>
> I really can't find the problem. I tried almost every combination with
> ' and " without any result.
>
> Thank you.
> Simon.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Regards
MANU
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.