Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML forms to insert data to MySQL

Status
Not open for further replies.

rskuse

Technical User
Jul 18, 2002
74
GB
Hi,

I am trying to insert data into a MySQL database using an HTML form.

The following code:
<?php

if ($submit):

$dbcnx = mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;);

mysql_select_db(&quot;awi&quot;);

$sql = &quot;insert into request set name='$name', company='$company', email='$email', username='$username', password='$password'&quot;;

if(@mysql_query($sql)) {
echo(&quot;Your request has been successfully sent, you will recieve an email shortly confirming your username and password&quot;);
}
else {
echo(&quot;There was an error sending your request: mysql_error()&quot;);

?>

is returning an error saying:
Parse error: parse error, unexpected $ in C:\Inetpub\ on line 74

but I can't work out where I am going wrong.

Can anyone help me?

Thankyou in advance,

Rach
 
Hi rskuse

Maybe the following link may help you
thread434-382555

I had a similar problem to you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top