<?
require("session.php");
$class_id=$_GET['id'];
$username=$_GET['username'];
$link_id=mysql_connect($dbhost,$dbuser,$dbpassword);
mysql_select_db($dbname,$link_id);
$str="delete from class where class_id = '$class_id ' and username= ' $username ' ";
$result=mysql_query($str,$link_id);
if($result)
echo"<script language='javascript'>alert('企业信息删除成功,点击确定返回');</script>";
mysql_close($link_id);
echo"<script language=javascript>window.location.href='qiye_view.php'</script>";
?>
require("session.php");
$class_id=$_GET['id'];
$username=$_GET['username'];
$link_id=mysql_connect($dbhost,$dbuser,$dbpassword);
mysql_select_db($dbname,$link_id);
$str="delete from class where class_id = '$class_id ' and username= ' $username ' ";
$result=mysql_query($str,$link_id);
if($result)
echo"<script language='javascript'>alert('企业信息删除成功,点击确定返回');</script>";
mysql_close($link_id);
echo"<script language=javascript>window.location.href='qiye_view.php'</script>";
?>
delete from class where class_id = '$class_id ' and username= ' $username '
delete from class where class_id = '$class_id ' and username= ' $username '
id class_id username
34 35051 kanetworkqiye2010
33 35051 jl151614
31 35054 jl151614 sql:
delete from class where class_id = '35051 ' and username= ' jl151614 ';
我看不出有问题~
id class_id username
34 35051 kanetworkqiye2010
33 35051 jl151614
31 35054 jl151614 sql:
delete from class where class_id = '35051 ' and username= ' jl151614 ';
我看不出有问题~
是不是username哪里多了个空格啊?
你的這個sql如果是原句的話.
很可能是出在空格上.
delete from class where class_id = '35051' and username='jl151614';
应写作
$str="delete from class where class_id = '$class_id' and username= '$username' ";