mysqlsae
elseif($keyword=="绩效查询")
{
$msgtype = "text";
$contentstr = "请输入您的学号";
$resultstr = sprintf($texttpl, $fromusername, $tousername, $time, $msgtype, $contentstr);
}else if(is_numeric($keyword)){
if(strlen($keyword)==7)
{
//////
$contentstr = "进入 if(strlen($keyword)==7)";
$resultstr = sprintf($texttpl, $fromusername, $tousername, $time, $msgtype, $contentstr);
////
$con = mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS); if(!$con) { ////// $contentStr = "进入 if(!$con)"; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); //// die('could not connect:'.mysql_error()); }else{ ///// $contentStr = "进入else"; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); ///// mysql_select_db("app_cjcx123",$con); $query = sprintf("SELECT * FROM table1 WHERE xm = 1450375"); $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { $contentStr=$row['xm'].$row['cj']; mysql_close($con); } } }else if(!is_numeric($keyword)){ $msgType = "text"; $contentStr = "学号错误,请重新输入"; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); }else{ $contentStr = "Input something..."; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); } } 这是源码。加了几个输出,卡到 $con = mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS); 这一句,后面的if else 都没进去,求教,连接数据库的 几个参数需要定义全局变量还是怎么弄
微信是一款手机通信软件,支持通过手机网络发送语音短信、视频、图片和文字。微信可以单聊及群聊,还能根据地理位置找到附近的人,带给大家全新的移动沟通体验,有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号