You have an error in your SQL syntax; check the manual that corresponds to your MySQL server。。
来源:百度知道 编辑:UC知道 时间:2024/05/15 14:15:38
运行一个程序时来出现这样的问题:
连接数据库成功
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'age=ee,regdate=323-00-00' at line 1
我的代码是:
<?php
//连接数据库
$link_id=mysql_connect("localhost","root","123456") or die("连接失败");
if($link_id)
{
echo "连接数据库成功";
echo "<br>";
//选择数据库
mysql_select_db("my_test") or die(mysql_error());
if(!$_GET['id'])
{
//显示用户列表
$sql="select *from userinfo";
$result=mysql_query($sql);
echo "<table border='1'>
<tr>
<td>编号</td>
<td>用户名称</td>
<td>性别</td>
<td>年龄</td>
<td>注册时间</td>
<td>操作&
连接数据库成功
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'age=ee,regdate=323-00-00' at line 1
我的代码是:
<?php
//连接数据库
$link_id=mysql_connect("localhost","root","123456") or die("连接失败");
if($link_id)
{
echo "连接数据库成功";
echo "<br>";
//选择数据库
mysql_select_db("my_test") or die(mysql_error());
if(!$_GET['id'])
{
//显示用户列表
$sql="select *from userinfo";
$result=mysql_query($sql);
echo "<table border='1'>
<tr>
<td>编号</td>
<td>用户名称</td>
<td>性别</td>
<td>年龄</td>
<td>注册时间</td>
<td>操作&
你打印出来看看,如果有字符串的字段的话,最好加''试试,$sql="update userinfo set usename='$usename',gender='$gender',age='$age',regdate='$regdate' where id=$id";
这类的,你试试看吧
应该就是楼上说的''""“”这些的问题。挨个试一下。
You have an error in your SQL syntax
请问这段代码为什么总是显示You have an error in your SQL syntax....at line 1
DO you have an appointment
Give me an example of an challenging goal you have set yourself in your study / reserach.
--I have got an offer in new york --oh,____ but i am going to miss you
in the case of transit, have you an entry permit for the final country of destination 请翻译
Have you done in the service industry?
When will Baidu.com have an IPO in China?
you have a coming call /You have an incoming call/You have incoming call 各是啥意思?
求“You have an incoming call”的WAP下载地址。