进程表单数据mysql php错误

时间:2015-12-06 02:04:24

标签: php mysql

我收到以下代码的错误,该代码尝试处理来自其他表单的数据以用于更新数据库。我不知道为什么会出现这个错误。警告:mysqli_fetch_array()要求参数1为mysqli_result,第28行的/ editrecord.php中给出布尔值

  <body>
    <?php 
    // connect to the DB
    include('includes/connect.php');
    // get value of id that sent from address bar
    $id=$_GET['id'];

    // Retrieve data from database 
    $sql="SELECT * FROM $Customers WHERE id='$id'";
    $result=mysqli_query($con, $sql);
    $rows=mysqli_fetch_array($result);
    ?>

    <table width="400" border="0" cellspacing="1" cellpadding="0">
    <tr>
    <form name="form1" method="post" action="update_ac.php">
    <td>
    <table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tr>
    <td>&nbsp;</td>
    <td colspan="3"><strong>Update data in mysql</strong> </td>
    </tr>
    <tr>
    <td align="center">&nbsp;</td>
    <td align="center">&nbsp;</td>
    <td align="center">&nbsp;</td>
    <td align="center">&nbsp;</td>
    </tr>
    <tr>
    <td align="center">&nbsp;</td>
    <td align="center"><strong>Name</strong></td>
    <td align="center"><strong>Lastname</strong></td>
    <td align="center"><strong>Email</strong></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td align="center">
    <input name="name" type="text" id="name" value="<? echo $rows['firstname']; ?>">
    </td>
    <td align="center">
    <input name="lastname" type="text" id="lastname" value="<? echo $rows['lastname']; ?>" size="15">
    </td>
    <td>
    <input name="email" type="text" id="email" value="<? echo $rows['email']; ?>" size="15">
    </td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>
    <input name="id" type="hidden" id="id" value="<? echo $rows['id']; ?>">
    </td>
    <td align="center">
    <input type="submit" name="Submit" value="Submit">
    </td>
    <td>&nbsp;</td>
    </tr>
    </table>
    </td>
    </form>
    </tr>
    </table>

    <?php
    // close connection 
    mysqli_close($con);
    ?>

0 个答案:

没有答案