当前位置:网站首页>PHP syntax summary
PHP syntax summary
2022-06-26 04:24:00 【Soo soo】
One 、 Database connection
1. Database configuration
$db = array();
$db['PassWord'] = '1'; // Database connection password
$db['UserName'] = 'root'; // Database connection user name
$db['database'] = 'talentpool'; // Database connection name
$db['hostname'] = '192.168.121.76:3306'; // Database connection server address
$connectistr="Provider=SQLOLEDB.1;Password=$db[PassWord];Persist Security Info=True;User ID=$db[UserName];Initial Catalog=$db[database];Data Source=$db[hostname]";
$GLOBALS['connection'] = new LADOConnection($connectistr);2. Database call
// First line database file import
require db.php;
$query = new LADQuery($GLOBALS['connection']);
$SQLText= "";
$query -> SetSQL($SQLText);
if ($query -> Open() == TRUE){
$temp = $query -> FieldByName('name') ->AsString(); // name Must be in select Queried in statement
}Two 、PHP Of for Circulation and foreach loop
// Calculate the length of the array count($arr)
foreach($arr as $data)
{
if($data['aa'] == 1){
// operation
}
}边栏推荐
- 使用Jsoup提取接口中的图片
- SQL related knowledge - constraints
- Knowledge of functions
- Video label forbids downloading. The test is valid. Hide button. The test is valid at three points
- Performance test comparison between PHP framework jsnpp and thinkphp6
- 2021-01-31
- ctf [RoarCTF 2019]easy_ calc
- 小程序中实现视频通话及互动直播功能
- Which is the best embedded visual programming software? (introduction, evaluation and selection of visual programming platform) [scratch, mind+, mixly]
- Oracle data pump table
猜你喜欢

The stc-isp burning program for 51 single chip microcomputer always shows that "the target single chip microcomputer is being detected..." the cold start board does not respond

Construction of art NFT trading platform | NFT mall
![[geek challenge 2019] rce me](/img/92/978c54fb42391198300c76ae92893d.jpg)
[geek challenge 2019] rce me
![There is no response to redirection and jump in the laravel constructor [original]](/img/6b/5d9d7fe1348892d01a87d04f122dfc.jpg)
There is no response to redirection and jump in the laravel constructor [original]

Install SVN in Pagoda and build SVN version Library

pip 批量完全卸载包

Performance test comparison between PHP framework jsnpp and thinkphp6

win10 系统打开的软件太小,如何变大(亲测有效)

六、项目实战---识别猫和狗

College C language final exam · multiple choice questions · summary notes of mistakes and difficulties
随机推荐
The open software of win10 system is too small. How to make it larger (effective through personal test)
[Qunhui] import certificate
Zhubo Huangyu: all the precious metals you want to know are here
Laravel uses phpword to generate word documents
Resolve PHP is not an internal or external command
mysql自帶的性能測試工具mysqlslap執行壓力測試
6、 Project practice --- identifying cats and dogs
Mutex of thread synchronization (mutex)
Conditional variables for thread synchronization
Minecraft 1.16.5 biochemical 8 module 1.9 version 1.18 version synchronization
MySQL's built-in performance testing tool, mysqlslap, performs stress testing
钉钉开放平台-小程序开发实战(钉钉小程序客户端)
Parse JSON interface and insert it into the database in batch
Read / write lock for thread synchronization
Simple personal summary of tp6 multi application deployment -- Part I [original]
Minecraft 1.16.5 生化8 模组 1.9版本 1.18版本同步
Analysis of updatechild principle of widget update mechanism of fluent
Analysis report on development status and future trend of CMOS image sensor industry in China 2022 ~ 2028
捕获数据包(Wireshark)
小程序中实现视频通话及互动直播功能