Jump to content


This topic is now archived and is closed to further replies.


PHP error

Recommended Posts

I am new to PHP and Mysql  I am getting an error from a piece of code that I copied from a tutorial and don't know how to fix it.

Here is the error

Parse error: parse error, unexpected ',' in /home/content/i/b/e/ibezamn/html/insert.php on line 21

Here is my code





@mysql_select_db($database) or die("Unable to select database");

$query="INSERT INTO roster VALUES(",'$first','$last','$number','$position','$height','$weight','$shoots','$dob')";

<a href="websiteinputform2.html">Add another player</a>

Thank you

Share this post

Link to post
Share on other sites
You had double quote (maked in red) in your query. Which was breaking the string. And thus you got the error.
[quote]$query="INSERT INTO roster VALUES([color=red][b]"[/b][/color],'$first','$last','$number','$position','$height','$weight','$shoots','$dob')";[/quote]

use this instead:
[code=php:0]$query="INSERT INTO roster VALUES(NULL,'$first','$last','$number','$position','$height','$weight','$shoots','$dob')";[/code]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.