![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| here is the script: <?php if($submit) { $db = mysql_connect("localhost", "root",""); mysql_select_db("learndb",$db); $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) VALUES ('$first','$last','$nickname','$$result = mysql_query($sql); echo "Thank you! Information entered.\n"; } else { ?> <form method="post" action="input.php"> First name:<input type="Text" name="first"><br> Last name:<input type="Text" name="last"><br> Nick Name:<input type="Text" name="nickname"><br> E-mail:<input type="Text" name="email"><br> Salary:<input type="Text" name="salary"><br> <input type="Submit" name="submit" value="Enter information"></form> <? } ?> --------- here is the error: Parse error: parse error, unexpected T_STRING in C:\Inetpub\wwwroot\Projects\doodle\input.php on line 8 ...... so what is the deal? yes im a newbie i know its probly sumthin stupid but thats what use guys are here for right? lolplease help | |||
| Advertisements |
| | #2 | ||
| You have chopped the end off your INSERT statement. You need the values for email and salary, thus: $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) VALUES ('$first','$last','$nickname','$email','$salary')" ; $result = mysql_query($sql); -- Charles Sweeney www.CharlesSweeney.com "mr bungle" <aaron@modnet.com.au> wrote in message news:3F2D0DFF.7040809@modnet.com.au... > here is the script: > <?php > if($submit) > { > $db = mysql_connect("localhost", "root",""); > mysql_select_db("learndb",$db); > $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) > VALUES ('$first','$last','$nickname','$$result = mysql_query($sql); > echo "Thank you! Information entered.\n"; > } > else > { > ?> > <form method="post" action="input.php"> > First name:<input type="Text" name="first"><br> > Last name:<input type="Text" name="last"><br> > Nick Name:<input type="Text" name="nickname"><br> > E-mail:<input type="Text" name="email"><br> > Salary:<input type="Text" name="salary"><br> > <input type="Submit" name="submit" value="Enter information"></form> > <? > } > ?> > --------- > here is the error: > Parse error: parse error, unexpected T_STRING in > C:\Inetpub\wwwroot\Projects\doodle\input.php on line 8 > ..... > so what is the deal? yes im a newbie i know its probly sumthin stupid > but thats what use guys are here for right? lolplease help > | |||
| | #3 | ||
| | |||
| Featured Websites | ||||
|
![]() |
| Tags: error, parse |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What does Parse error: parse error, unexpected T_STRING mean? | EV3 | PHP | 3 | 07-01-2007 3:56 PM |
| cvs: pear /Text_Wiki/Text/Wiki/Parse/Creole Url.php | Michele Tomaiuolo | Pear | 0 | 05-27-2007 7:47 PM |
| cvs: pear /Text_Wiki/Text/Wiki/Parse/Creole Footnote.php | Michele Tomaiuolo | Pear | 0 | 05-27-2007 7:47 PM |
| cvs: pear /Text_Wiki/Text/Wiki/Parse/Creole List.php | Michele Tomaiuolo | Pear | 0 | 05-27-2007 7:47 PM |
| cvs: pear /Text_Wiki/Text/Wiki/Parse/Creole Url.php | Michele Tomaiuolo | Pear | 0 | 05-27-2007 7:47 PM |
| Featured Websites | ||||
|