标题:
MySQL中的菜问题
[打印本页]
作者:
chooser
时间:
2006-4-10 14:34
标题:
MySQL中的菜问题
<?php
session_start();
$ksh=$user;
if (!session_is_registered("user")&!session_is_registered("passwd"))
{
Header("Location:newstu.php") ;
exit;
}
?>
$db = mysql_connect("localhost","root","");
mysql_select_db ("mydata");
$xh = mysql_query ("select xh from lqdyk where ksh='$ksh'");
$xm = mysql_query ("select xm from lqdyk where ksh='$ksh'");
$result = mysql_query ("insert into maildata (ksh, xh, xm, yhm, mm)
VALUES ('$ksh', '$xh', '$xm', '$yhm','$mm')");
这个的问题在哪里?
为什么取不回$xh和$xm呢?
作者:
陶江
时间:
2006-4-10 14:36
mysql_query 查询到的关不是 $xh $xm 的值.
相关内容,请参阅
mysql手册.
呵呵
作者:
WMPlayer
时间:
2006-4-10 14:38
list($xh) = mysql_fetch_row(mysql_query ("select xh from lqdyk where ksh='$ksh'"));
list($xm) = mysql_fetch_rowmysql_query ("select xm from lqdyk where ksh='$ksh'"));
作者:
jiyangonline
时间:
2006-4-10 14:39
$db = mysql_connect("localhost","root","");
mysql_select_db ("mydata");
$res = mysql_query ("select xh,xm from lqdyk where ksh='$ksh'");
$resArr = mysql_fetch_array($res);
$xh = $resArr['xh'];
$xm = $resArr['xm'];
$result = mysql_query ("insert into maildata (ksh, xh, xm, yhm, mm)
VALUES ('$ksh', '$xh', '$xm', '$yhm','$mm')");
欢迎光临 编程开发论坛 (http://bbs.lihuasoft.net/)
Powered by Discuz! 6.0.0