Mysql 在php中编辑和更新文本区域

Mysql 在php中编辑和更新文本区域,mysql,php-5.6,Mysql,Php 5.6,当im在表单中添加我的文本区域时,我的php函数不起作用。其他所有输入或工作。如果im添加备注(文本区域)表单编辑功能无法显示该备注中的文本。其他输入可见,但我无法再次保存 请帮我纠正我的错误 在“html”之前编写代码 <?php function renderForm($id, $vehicle_type, $duration, $amount,$remarks, $error) { ?> 我的HTML表单 <form action="" method="po

当im在表单中添加我的文本区域时,我的php函数不起作用。其他所有输入或工作。如果im添加备注(文本区域)表单编辑功能无法显示该备注中的文本。其他输入可见,但我无法再次保存

请帮我纠正我的错误

在“html”之前编写代码

<?php

function renderForm($id, $vehicle_type, $duration, $amount,$remarks, $error)

{

?>

我的HTML表单

<form action=""  method="post"> 
                <div class="row">
                <input type="hidden" name="id" value="<?php echo $id; ?>"/>
                        <div class="col-lg-4 col-xs-6" class="form-group">
                    <label>Vehicle Type <span style="color:red;font-size:8px;"><i class="fa fa-asterisk" aria-hidden="true"></i></span></label>
                        <select name="vehicle_type" class="form-control">
                        <option <?php echo ($vehicle_type=='Bicycle')?'selected':'' ?>>Bicycle</option>
                        <option <?php echo ($vehicle_type=='Bike')?'selected':'' ?>>Bike </option>
                        <option <?php echo ($vehicle_type=='Cars')?'selected':'' ?>>Cars </option>
                        <option <?php echo ($vehicle_type=='Truck')?'selected':'' ?>>Truck</option>
                        <option <?php echo ($vehicle_type=='Others')?'selected':'' ?>>Others</option>

                    </select>
                    </div>


                    <div class="col-lg-4 col-xs-6" class="form-group">
                    <label>Duration </label> <span style="color:red; font-size:8px; "><i class="fa fa-asterisk" aria-hidden="true"></i></span>
                                      <input type="text" value="<?php echo $duration; ?>" name="duration" class="form-control" maxlength="20" placeholder="Eg:  4 Hrs">
                        </div>

                        <div class="col-lg-4 col-xs-6" class="form-group">
                        <label><i class="fa fa-inr" aria-hidden="true"></i> Amount</label> <span style="color:red;font-size:8px;"><i class="fa fa-asterisk" aria-hidden="true"></i></span>
                        <input type="number" name="amount" value="<?php echo $amount; ?>" class="form-control"  placeholder="00">
                        </div>
                    </div>

                        <div class="row">
                          <div class="col-lg-4 col-xs-6" class="form-group">

                           <label>Remarks</label>
                            <textarea class="form-control" name="remarks" <?php echo htmlspecialchars($remarks); ?> rows="3" placeholder="Enter ..."></textarea>
                            </div>


                         <div id="butn"  class="col-lg-3 col-xs-3">
                         <button class="myButton" type="submit" name="submit"  value="Submit" class="btn btn-block btn-success btn-lg">SAVE</button>
                         </div>

                        </div>
            </form> 


看看浏览器中的实际HTML。您正在将“备注”内容呈现为
textarea
元素的属性:

<textarea class="form-control" name="remarks" <?php echo htmlspecialchars($remarks); ?> rows="3" placeholder="Enter ..."></textarea>


您的SQL语法有错误;检查与您的MariaDB服务器版本相对应的手册,以获取第行“WHERE id='31'附近要使用的正确语法1@KRISHNAKANTH:那么您的SQL语法有错误。查看产生该错误的查询,并查看
WHERE
之前的最后一件事。您是否遇到任何异常?
<textarea class="form-control" name="remarks" <?php echo htmlspecialchars($remarks); ?> rows="3" placeholder="Enter ..."></textarea>
<textarea class="form-control" name="remarks" rows="3" placeholder="Enter ..."><?php echo htmlspecialchars($remarks); ?></textarea>