<?php
return array (
'default' => array (
'hostname' => '127.0.0.1',
'database' => 'phpcms',
'username' => 'root',
'password' => 'root',
'tablepre' => 'v9_',
'charset' => 'utf8',
'type' => 'mysql',
'debug' => true,
'pconnect' => 0,
'autoconnect' => 0
),
);
?>123456789101112131415161718
$mysql_user=include(PHPS_PATH.'/caches/configs/database.php');//得到数据库配置
$username=$mysql_user['default']['username'];
$password=$mysql_user['default']['password'];
$tablepre=$mysql_user['default']['tablepre'];
$database=$mysql_user['default']['database'];
$con = mysqli_connect($mysql_user['default']['hostname'],$username,$password);//句柄
mysqli_select_db($con,$database);//选择数据库
$sql = ' SELECT * FROM '.$tablepre."pay_account where trade_sn='".$out_trade_no."'";
//file_put_contents('3.txt',$sql);
<div id="studentRead" class="reading" style="z-index:10" >
<div class="class-table">
<div class="class-table-tit clearfix">
<h3 class="fl">班级课程表</h3>
<a class="fr" id ='studentEditKcb' attr="edit" onclick = "editKcb(this);" style="cursor:pointer;">编辑
</a>
</div>
<table border="0" cellspacing="0" cellpadding="0" id = "myTable">
<tr>
<th width="5%"></th>
<th width="19%">周一</th>
<th width="19%">周二</th>
<th width="19%">周三</th>
<th width="19%">周四</th>
<th width="19%">周五</th>
</tr>
<tr id = "focustr">
<td rowspan="4" class="td-bg">上<br/>午</td>
<volist name = "dataListStu" id = "val" offset="0" length='1'>
<volist name = "val" id = "value">
<td>
<input id = "focusId" readonly="true" maxlength='7' type="text" value="{$value}" />
</td>
</volist>
</volist>
</tr>
<volist name = "dataListStu" id = "val" offset="1" length='3'>
<tr>
<volist name = "val" id = "value">
<td>
<input readonly="true" maxlength='7' type="text" value="{$value}" />
</td>
</volist>
</tr>
</volist>
<tr>
<td rowspan="4" class="td-bg">课<br/>表</td>
<volist name = "dataListStu" id = "val" offset="4" length='1'>
<volist name = "val" id = "value">
<td>
<input readonly="true" maxlength='7' type="text" value="{$value}" />
</td>
</volist>
</volist>
</tr>
<volist name = "dataListStu" id = "val" offset="5" length='3'>
<tr>
<volist name = "val" id = "value">
<td>
<input readonly="true" maxlength='7' type="text" value="{$value}" />
</td>
</volist>
</tr>
</volist>
</table>
</div>
</div>
$result2=mysqli_query($con,$sql);
$orderinfo=mysqli_fetch_array($result2);;
$uid=$orderinfo['userid'];
//更新数据库
$sql4 = ' update '.$tablepre."pay_account set status= 'succ' where userid=".$uid ." and trade_sn='".$out_trade_no."'";
$result4=mysqli_query($con,$sql4);
mysqli_close($con);