解析错误:语法错误,意外','in

时间:2018-01-29 00:30:57

标签: php mysqli

我刚开始学习PHP语言。 我有,

Parse error: syntax error, unexpected ',' in /Applications/XAMPP/xamppfiles/htdocs/testweb/proses_daftar.php on line 7

这是我的proses_daftar.php

    <?php
 session_start();
include('config/koneksi.php');

if(isset($_POST['daftar']))
{
    $name = mysqli_real_escape_string(($con,$_POST['name']));
    $username = mysqli_real_escape_string(htmlentities($_POST['username']));
    $email = mysqli_reali_escape_string(htmlentities($_POST['email']));
    $password = mysql_reali_escape_string(htmlentities($_POST['password']));
    $retype_password = mysqli_real_escape_string(htmlentities($_POST['retype_password']));

我的错在哪里?

1 个答案:

答案 0 :(得分:-1)

替换:

$name = mysqli_real_escape_string(($con,$_POST['name']));

使用:

$name = mysqli_real_escape_string($con, $_POST['name']);

然后将$con作为mysqli_real_escape_string的所有其他调用中的第一个参数。