Php var_dump中显示的空字段
我正在尝试更新产品的所有字段,除了produt name字段 下面是我的var_dumpPhp var_dump中显示的空字段,php,html,mysql,Php,Html,Mysql,我正在尝试更新产品的所有字段,除了produt name字段 下面是我的var_dump string 'UPDATE product SET `discription` = 'sasasaas', `product_name` ='', category_id = 14, price=10000, first_price=1000, second_price=1000, third_price=10000, fourth_price=10000, total_discount
string 'UPDATE product SET
`discription` = 'sasasaas',
`product_name` ='',
category_id = 14,
price=10000,
first_price=1000,
second_price=1000,
third_price=10000,
fourth_price=10000,
total_discount=10000,
product_quantity_discount=10000,
weight=10000,
dimension=1000,
`shipping_class`='sasasas',
stock_quantity=1000,
`stock_status`='inorder',
`back_order`='ALLow'
WHERE product_id = 13' (length=511)
我的问题是,为什么我会收到产品_name=”“empty
这是我的代码
<label for="exampleInputEmail1">Product Name</label>
<input type="text" name="product_name" class="form-control" value="<?php
echo($row['product_name']);?>">
$this->product_discription = trim ( mysql_prep ( $_POST ['discription'] ) );
$this->category_id = mysql_prep ( $_POST ['data_category'] );
$this->regular_price = trim ( mysql_prep ( $_POST ['regular_price'] ) );
$this->price1 = trim ( mysql_prep ( $_POST ['price1'] ) );
$this->price2 = trim ( mysql_prep ( $_POST ['price2'] ) );
$this->price3 = trim ( mysql_prep ( $_POST ['price3'] ) );
$this->price4 = trim ( mysql_prep ( $_POST ['price4'] ) );
$this->total_discount = trim ( mysql_prep ( $_POST ['total_discount'] ) );
$this->product_qantity_discount = trim ( mysql_prep ( $_POST ['quantity_discount'] ) );
$this->weight = trim ( mysql_prep ( $_POST ['weight'] ) );
$this->dimension = trim ( mysql_prep ( $_POST ['dimension'] ) );
$this->shipping_class = trim ( mysql_prep ( $_POST ['shipping'] ) );
$this->stock_quantity = trim ( mysql_prep ( $_POST ['stock'] ) );
$this->stock_status = mysql_prep ( $_POST ['stock_status'] );
$this->back_order = mysql_prep ( $_POST ['back_order'] );
$this->product_name = mysql_prep ( $_POST ['product_name'] ) ;
$this->id = $_GET ['id'];
$this->sql = "UPDATE product SET
`discription` = '{$this->product_discription}',
`product_name` ='{$this->product_name}',
category_id = {$this->category_id},
price={$this->regular_price},
first_price={$this->price1},
second_price={$this->price2},
third_price={$this->price3},
fourth_price={$this->price4},
total_discount={$this->total_discount},
product_quantity_discount={$this->product_qantity_discount},
weight={$this->weight},
dimension={$this->dimension},
shipping_class='{$this->shipping_class}',
stock_quantity={$this->stock_quantity},
stock_status='{$this->stock_status}',
back_order='{$this->back_order}'
WHERE product_id = {$this->id}";
mysql_query($this->sql);
confirm_query($this->sql);
echo var_dump($this->sql ,TRUE);
产品名称
您似乎在此处输入了一个错误:
$this->produt_name
除了您在$this->produt\u name中拼写产品错误之外,尽管它看起来是一致的var\u dump($\u POST['product\u name'])
?字符串“”(长度=0)空字符串!!因此,您发布的值是空的(它与MySQL或PHP无关(除非您取消设置此值))。你确定你在填写吗?您确定字段的名称正确吗?请查看您的网络选项卡。字段设置正确且html正确evey feild是正确的,但我没有得到产品名称字段字符串“”(长度=0)空字符串您检查了帖子数据吗?$\u POST['product\u name']
中有什么内容?POST数据中有一个空字段。您确定没有其他html格式的名为product\u name
的元素吗?