本文目錄一覽:
- 1、asp轉化為php
- 2、ASP代碼轉換PHP
- 3、asp程序代碼轉成php
asp轉化為php
用stream_context_create();
fopen( );
用這兩個函數看能不能取數據
ASP代碼轉換PHP
?php
$con=mysql_connect(‘數據庫域名’,’賬戶’,’密碼’);
mysql_select_db(‘數據庫名’,$con);
$res=mysql_query(“select * from 數據表 where uname=False order by Time desc limit 0,10”,$con);
while($row=mysql_fetch_array($res)){
echo $row[0];
echo $row[1];
…………….
}
?
asp程序代碼轉成php
?php
$sql=”select top 10 車牌號碼,出車日期,出車時間,用車目的地,用車人,駕駛員,是否回車 from 車輛派車信息 where 是否回車=0 order by 出車日期 desc”
//設置編碼
mysql_query(“set names gbk”);
//執行sql查詢
$result=mysql_db_query($mysql_database,$sql,$conntion) or die(“查詢失敗!錯誤是:”.mysql_error());
//返回多少條記錄
$count=mysql_num_rows($result);
if(!$count){
echo “沒有記錄”;
}else{
while($rs=mysql_fetch_array($result)){
?
tr height=”20″td title=”車牌:%=rs(“車牌號碼”)% 日期:?php echo $rs(“出車日期”)? …../td/tr
?php
}
?
沒測試,有錯誤的地方自己改
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/198508.html