Need help connecting or do I???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dgny06
Forum Commoner
Posts: 25
Joined: Thu Jun 14, 2007 11:35 pm

Need help connecting or do I???

Post 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]
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

hint: your missing a semi-colon :wink:
dgny06
Forum Commoner
Posts: 25
Joined: Thu Jun 14, 2007 11:35 pm

Post by dgny06 »

wow....is may face red....thank you for catching that
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You might want to edit your post and put the PHP code in PHP tags before the monsters get you.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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
Post Reply