PHP + MySQL 项目教程

PHP + MySQL 项目教程 扫二维码继续学习 二维码时效为半小时

PHP + MySQL 项目教程,PHP基础技术和MySQL项目开发基础

该课程属于 2017级软件技术2班
请加入后再学习

insert into student (xh,xm)values(20170533120231,'胡伟'); select * from student; insert into score(xh,kcid,cj)values(2070533120231,'kc001',100); select * from score; select a.xm,b.kcmc,c.cj frpm student a,course b,score c where c.xh = a.xh and c.kcid=b.kcid and c.xh = '20170533120231';

[展开全文]

insert into student (xh,xm)valuse(20170533120247,'方志伟');
select * from student;
insert into score(xh,kcid,id)valuse(20170533120247,'KC001',100);
select * from score;
select a,xm,b,kcmc,c,.cj frpm student a,course b,score c where c.xh=a.xh and c.kcid=b.kcid and c.xh='20170533120247';

[展开全文]

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

[展开全文]