NewFuture
New Member
- Messages
- 1,658
- Reaction score
- 0
- Points
- 0
i am creating a submit high scores script kind of thing using php and mysql database, i have enclosed a step by step, i am currently on step 4, at the very bottom of the step, when i test my script i recieve error -4 (this will be all clear when you read step by step) therefore there is somthing wrong with my script, i have also enclosed my script sofar can anyone help me and tell me where i am going wrong? and how i can get it to work?
Step By Step:
http://www.peachpit.com/content/images/0321223659/files/Web_Lesson.pdf
My script sofar:
<?PHP
$name = $_POST['name'];
$score = $_POST['score'];
$link = @mysql_connect("localhost", "nwfuture_admin", "HIDDEN THE PASSWORD");
if (mysql_errno()){
exit("-2");
}
mysql_select_db('nwfuture_scoretest', $link);
if (mysql_errno()){
exit("-3");
}
$sql = "INSERT INTO scores(name, score) VALUES('$name', $score)";
$result = mysql_query($sql, $link);
if (mysql_errno()){
exit("-4");
}
exit("1");
?>
Step By Step:
http://www.peachpit.com/content/images/0321223659/files/Web_Lesson.pdf
My script sofar:
<?PHP
$name = $_POST['name'];
$score = $_POST['score'];
$link = @mysql_connect("localhost", "nwfuture_admin", "HIDDEN THE PASSWORD");
if (mysql_errno()){
exit("-2");
}
mysql_select_db('nwfuture_scoretest', $link);
if (mysql_errno()){
exit("-3");
}
$sql = "INSERT INTO scores(name, score) VALUES('$name', $score)";
$result = mysql_query($sql, $link);
if (mysql_errno()){
exit("-4");
}
exit("1");
?>