Jump to content


Photo

[SOLVED] Whats wrong with this code?


  • Please log in to reply
2 replies to this topic

#1 tomash

tomash
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 13 September 2006 - 08:31 PM

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

the error I'm getting is:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ******************************** on line 56


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!

#2 maxic0

maxic0
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 13 September 2006 - 08:36 PM

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  ;)

#3 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 13 September 2006 - 08:38 PM

This is wrong: you use single quotes within a single-quoted string:

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

Ronald  8)
RTFM is an almost extinct art form, it should be subsidized.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users