Jump to content

Archived

This topic is now archived and is closed to further replies.

tomash

[SOLVED] Whats wrong with this code?

Recommended Posts

[code](Line 56) $updt = "UPDATE HillHouse SET content='$_POST['pCContent']', date='$_POST['date']', time='$_POST['time']'
WHERE name='$pagename'";[/code]

the error I'm getting is:
[quote]Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ******************************** on line 56[/quote]

It is connecting to the database fine.

I think this may be in the wrong place - sorry if it is. Its just it uses php aswell so...

Thanks for your help. It's probably something stupid i've missed!

Share this post


Link to post
Share on other sites
Im not sure but i think its cause you got the '$_POST['whatever']'.
The quote marks are the same..
Try setting all the $_POST as variables.

So like $whatever = $_POST['whatever'];

and then insert '$whatever'.

Hope this helps  ;)

Share this post


Link to post
Share on other sites
This is wrong: you use single quotes within a single-quoted string:

[code]content='$_POST['pCContent']' AND date='$_POST['date']'[/code]

Ronald  8)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.