帮看下这段代码,插入数据库部分出有关问题,没找到异常
程序员文章站
2024-02-16 12:17:52
...
帮看下这段代码,插入数据库部分出问题,没找到错误
War-game -Add Your score War game - add your score
if(!empty($_POST['submit']))
{
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$score=$_POST['score'];
echo $first_name;
echo $last_name;
echo $score;
$dbc=mysqli_connect('localhost','root','pengyu2408','score_list')or die('error in connet');
$query="INSERT INTO score_lis(first_name,last_name,score) VALUES('$first_name','$last_name','$score')";
mysqli_query($dbc,$query)or die('error_2');
echo 'Thanks for adding your new high score!
';
echo 'FIRST_NAME:'.$first_name.'
';
';
echo 'LAST_NAME:'.$last_name.'
echo 'Score:'.$score.'
';
echo '';
//clear the score data to clear the form
$firet_name="";
$last_name="";
mysqli_close($dbc);
}
?>相关文章
相关视频
上一篇: Android程序读取数据库失败问题
下一篇: 程序逻辑有有关问题,请帮忙