求指点 求助 圣诞快乐 ~ 本帖最后由 neuuuuuuu 于 2014-12-25 17:58:02 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sql语句为何不用引号引起来$sql= “update shopsystem set name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id”; 引号加了 也报错 = - Notice: Undefined variable: name in G:\wamp\www\net work\xiugai.php on line 12Notice: Undefined variable: tel in G:\wamp\www\net work\xiugai.php on line 12貌似执行了 但是数据库里是空白数据 $name ,$tel 变量在哪定义的? 1.$sql= update shopsystem set name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id;改为$sql= "update shopsystem set name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id";2.$name, $tel这两个变量你没有赋值。 <?php$conn=mysql_connect('localhost','root','');mysql_select_db('root'); mysql_query("set names 'GBK'");?><?php$id = $_GET["id"];$sql="select * from shopsystem where id=$id";$query=mysql_query($sql);$rs=mysql_fetch_array($query);?><form method="post" action="xiugai.php"><tr><td><P>:      <input type="hidden" id="id" value="<?php echo $rs['id']?>"/> *</P><P>:      <input type="text" id="name" value="<?php echo $rs['name']?>"/> *</P><P>:      <input type="text" id="tel" value="<?php echo $rs['tel']?>"/> *</P><P>:      <input type="text" id="email" value="<?php echo $rs['email']?>"/> *</P><P>:        <input type="text" id="QQ" value="<?php echo $rs['QQ']?>"'/> *</P><P>:      <input type="text" id="addr" value="<?php echo $rs['addr']?>"/> *</P><P>:      <input type="text" id="sex" value="<?php echo $rs['sex']?>"/> *</P><P>:  <input type="text" id="brandname" value="<?php echo $rs['name']?>"/> *</P><P>:  <input type="text" id="commoditybrand" value="<?php echo $rs['commoditybrand']?>"/> *</P><P>:  <input type="text" id="productID" value="<?php echo $rs['productID']?>"/> *</P><P>:  <input type="text" id="ordername" value="<?php echo $rs['ordername']?>"/> *</P><P>:  <input type="text" id="shopname" value="<?php echo $rs['shopname']?>"/> *</P><P>:  <input type="text" id="shopaddr" value="<?php echo $rs['shopaddr']?>"/> *</P><P>:  <input type="text" id="invoicenumber" value="<?php echo $rs['invoicenumber']?>"/> *</P><P>:  <input type="text" id="purchasingdate" value="<?php echo $rs['purchasingdate']?>"/> *</P><P>:1990-01-01  * </P><td><input name='del' type='submit' id='del' value='修改' /></td></tr></from><?php $conn = mysql_connect("localhost", "root", "");if (!$conn) { die('Could not connect: ' . mysql_error()); }mysql_select_db("root",$conn)or die(mysql_error());mysql_query('set names GB2312');$sql= "UPDATE shopsystem SET name=$name,tel=$tel,email=$email,QQ=$QQ,addr=$addr,sex=$sex,brandname=$brandname,commoditybrand=$commoditybrand,productID=$productID,ordername=$ordername,shopname=$shopname,shopaddr=$shopaddr,invoicenumber=$invoicenumber,purchasingdate=$purchasingdate WHERE id=$id";if (!mysql_query($sql,$conn)) { die ('Error: ' . mysql_error()); }mysql_close($conn);?>完整的代码 = - 求助 因为论坛屏蔽 = - input前面的字段我就删了 那个表单里所有变量都在报错 急!这样的 .htaccess 重写规则怎么写? php 读取mysql是乱码 php+apache 配置问题 新手求教php中多维数组的读取 字符串检索的问题 有关页面下载的问题 请问php.exe, php-cgi.exe, php-win.exe 的区别 解决后既散分:关于修改文本文件的问题 请问“第 1 2 3 ...页”这种分页显示怎么做? zend2.6谁有key的进来支援我一个阿,我哭了,200分求一个 php 简单的图片上传问题 move_uploaded_file()总是出错 富文本内容保存工具,我自己写的东西
$sql= “update shopsystem set name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id”;
Notice: Undefined variable: name in G:\wamp\www\net work\xiugai.php on line 12
Notice: Undefined variable: tel in G:\wamp\www\net work\xiugai.php on line 12
貌似执行了 但是数据库里是空白数据
$sql= update shopsystem set name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id;
改为
$sql= "update shopsystem set name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id";2.$name, $tel这两个变量你没有赋值。
$conn=mysql_connect('localhost','root','');
mysql_select_db('root');
mysql_query("set names 'GBK'");
?><?php
$id = $_GET["id"];
$sql="select * from shopsystem where id=$id";
$query=mysql_query($sql);
$rs=mysql_fetch_array($query);
?><form method="post" action="xiugai.php">
<tr>
<td>
<P>:      <input type="hidden" id="id" value="<?php echo $rs['id']?>"/> *</P>
<P>:      <input type="text" id="name" value="<?php echo $rs['name']?>"/> *</P>
<P>:      <input type="text" id="tel" value="<?php echo $rs['tel']?>"/> *</P>
<P>:      <input type="text" id="email" value="<?php echo $rs['email']?>"/> *</P>
<P>:        <input type="text" id="QQ" value="<?php echo $rs['QQ']?>"'/> *</P>
<P>:      <input type="text" id="addr" value="<?php echo $rs['addr']?>"/> *</P>
<P>:      <input type="text" id="sex" value="<?php echo $rs['sex']?>"/> *</P><P>:  <input type="text" id="brandname" value="<?php echo $rs['name']?>"/> *</P>
<P>:  <input type="text" id="commoditybrand" value="<?php echo $rs['commoditybrand']?>"/> *</P>
<P>:  <input type="text" id="productID" value="<?php echo $rs['productID']?>"/> *</P>
<P>:  <input type="text" id="ordername" value="<?php echo $rs['ordername']?>"/> *</P><P>:  <input type="text" id="shopname" value="<?php echo $rs['shopname']?>"/> *</P>
<P>:  <input type="text" id="shopaddr" value="<?php echo $rs['shopaddr']?>"/> *</P>
<P>:  <input type="text" id="invoicenumber" value="<?php echo $rs['invoicenumber']?>"/> *</P>
<P>:  <input type="text" id="purchasingdate" value="<?php echo $rs['purchasingdate']?>"/> *</P>
<P>:1990-01-01  * </P>
<td><input name='del' type='submit' id='del' value='修改' /></td>
</tr>
</from><?php $conn = mysql_connect("localhost", "root", "");if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("root",$conn)or die(mysql_error());
mysql_query('set names GB2312');
$sql= "UPDATE shopsystem SET name=$name,tel=$tel,email=$email,QQ=$QQ,addr=$addr,sex=$sex,brandname=$brandname,commoditybrand=$commoditybrand,productID=$productID,ordername=$ordername,shopname=$shopname,shopaddr=$shopaddr,invoicenumber=$invoicenumber,purchasingdate=$purchasingdate WHERE id=$id";if (!mysql_query($sql,$conn))
{
die ('Error: ' . mysql_error());
}mysql_close($conn);
?>
完整的代码 = - 求助
那个表单里所有变量都在报错