Re: Writing to an MySQL Database
On Fri, 2004-07-02 at 09:05, Michael Mason wrote: > It’s the “Data Capture section that’s causing issues. I keep getting > an error telling me there’s an “Unexpected $” on a line that’s > actually outside even the HTML tag. Errors like "unexpected $" that are output by a code or statement parser are sometimes related to the parser running off the end of its input. "$" is tokening parser parlance for "end of input/file". So "unexpected $" really means "unexpectedly reached the end of the file". As others have pointed out, this is because you were missing a quote that closes a string. -- Andy Bakun: a killer headache <[EMAIL PROTECTED]> -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Writing to an MySQL Database
Michael, you're missing a quote just before the last semi-colon. PB - Original Message - From: Michael Mason To: 'MySQL Mailing List' Sent: Friday, July 02, 2004 9:05 AM Subject: Writing to an MySQL Database Im confused and obviously missing something really fundamental here I would appreciate it if you could glance at my code for the above. Basically Im trying to write information to the database now I have managed to resolve the connection issue. Its the Data Capture section thats causing issues. I keep getting an error telling me theres an Unexpected $ on a line thats actually outside even the HTML tag. Michael Mason Business Support Services Arras® People Tel: 01706 342310 Mobile: 07793 782287 Fax: 01706 642754 Member of the Recruitment Employment Confederation (00052055) The views expressed in this mail are entirely those of the sender, and do not necessarily represent the views or position of Arras Services Ltd. The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in relation to the contents of this information is strictly prohibited and may be unlawful. Neither the sender nor the represented institution is liable for the correct and complete transmission of the contents of this e-mail, or for its timely receipt. -- MySQL General Mailing ListFor list archives: http://lists.mysql.com/mysqlTo unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
Re: Writing to an MySQL Database
> It's the "Data Capture section that's causing issues. I keep getting an > error telling me there's an "Unexpected $" on a line that's actually outside > even the HTML tag. You forgot to end the $sql = ".. with a closing quote. The line now ends with ); while you probably want it to be )"; BTW it's not necessary or even wise to quote every variable you use: mysql_connect ("$host", "$user", "$password") would preferrably be: mysql_connect ($host, $user, $password) Regards, JIgal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Writing to an MySQL Database
You're missing a closing " at the end of your sql on the last line which may be throwing up an error. Cheers, Matt On 2 Jul 2004, at 15:05, Michael Mason wrote: -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Writing to an MySQL Database
I’m confused and obviously missing something really fundamental here… I would appreciate it if you could glance at my code for the above. Basically I’m trying to write information to the database now I have managed to resolve the connection issue. It’s the “Data Capture section that’s causing issues. I keep getting an error telling me there’s an “Unexpected $” on a line that’s actually outside even the HTML tag. Michael Mason Business Support Services Arras® People Tel: 01706 342310 Mobile: 07793 782287 Fax: 01706 642754 Member of the Recruitment Employment Confederation (00052055) The views expressed in this mail are entirely those of the sender, and do not necessarily represent the views or position of Arras Services Ltd. The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in relation to the contents of this information is strictly prohibited and may be unlawful. Neither the sender nor the represented institution is liable for the correct and complete transmission of the contents of this e-mail, or for its timely receipt. <><>"; echo "UserID: \t\t"; echo ""; echo "Password: \t \t"; echo ""; echo "a little about me: \t"; echo ""; echo "more about me: \t"; echo ""; echo "\t\t\t"; echo ""; /* Data Capture */ $NewUserID=$_POST['TXT_UserID']; $NewUserPassword=$_POST['TXT_UserPassword']; $NewUserComments=$_POST['TXT_Comments']; $NewUserFurtherComments=$_POST['TXT_FurtherComments']; $sql = "INSERT INTO RegisteredMembers (TXT_UserID,TXT_UserPassword,TXT_Comments,TXT_FurtherComments) VALUES('$NewUserID','$NewUserPassword','$NewUserComments','$NewUserFurtherComments'); ?> -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]