Page 1 of 1

Need help connecting or do I???

Posted: Thu Jun 14, 2007 11:44 pm
by dgny06
patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi everybody.....I thank you in advance for any help. I am new to PHP but from what I have been learning, I absolutely love it. I currently have my hosting at GoDaddy and I am trying to connect to my Database on a page that is called from a form. It seems as if I am connecting to the Database because I am not getting any connection errors, but I keep getting a "Parse error: parse error, unexpected T_VARIABLE in /home/content/m/o/t/xxxxxx/html/test/EmailFormSubmission.php on line 20" error 

I have pretty good SQL experience and in looking at my query string, I can not see what I am doing wrong. Can someone please let me know what I am doing wrong based on my code below. Also, is there anything else I have to do to commit the insert statement such as a commit command or anything?

Code: Select all

<?PHP 

mysql_connect('host,'uname','password');

mysql_select_db('dbname')

/* LINE 20 */  $query = "INSERT INTO tbUser (FirstName, LastName, Email) VALUES('FName', 'LName', 'EmailAddress')";
mysql_query("$query");



?>
patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Jun 14, 2007 11:46 pm
by John Cartwright
hint: your missing a semi-colon :wink:

Posted: Thu Jun 14, 2007 11:52 pm
by dgny06
wow....is may face red....thank you for catching that

Posted: Fri Jun 15, 2007 12:05 am
by Benjamin
You might want to edit your post and put the PHP code in PHP tags before the monsters get you.

Posted: Fri Jun 15, 2007 2:56 am
by patrikG
astions wrote:You might want to edit your post and put the PHP code in PHP tags before the monsters get you.
Too late. Old ghastly granny got him! ;)

Image