mysql-新浪sae, 微信公众平台的MySQL链接问题

WBOY
Lepaskan: 2016-06-06 09:36:06
asal
896 orang telah melayarinya

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);
////

<code>                $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 都没进去,求教,连接数据库的 几个参数需要定义全局变量还是怎么弄</code>
Salin selepas log masuk
Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan