当前位置:网站首页>PDO operation
PDO operation
2022-07-23 17:49:00 【Ideal coder】
Database connection :
<?php
try {
$dbh = new PDO('mysql:host=localhost;dbname=xb_yxb', "root", "123");
foreach($dbh->query('SELECT long_name from user limit 10') as $row) {
print_r($row);
$dbh = null;
}catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
边栏推荐
- LeetCode_ 724_ Find the central subscript of the array
- 基于scrapy的电商平台数据爬取与展示
- 深拷贝deepClone的实现
- 别再问我MySQL为啥没走索引?就这几种原因,全都告诉你
- 一次线上频繁FullGC的排查
- Food safety chocolate is also true or false? How much do you know about it
- Do you dare to use BigDecimal without mastering these pits?
- Food safety | ham sausage lunch meat, is it really so unbearable?
- 59. General knowledge of lightning safety
- xlinx pcie xvc
猜你喜欢

rust统计文件中单词出现的次数

活动报名:如何零基础快速上手开源的 Tapdata Live Data Platform?

Time series data in industrial Internet of things

Aike AI frontier promotion (7.23)

TwinCAT 3 首次运行报错4115

基于策略路由部署的网络多出口设计研究与实现

ride the wind and waves! Digital transformation in the era of financial technology

Leetcode skimming: dynamic planning 04 (different paths)

工业物联网中的时序数据

SAP HANA数据库备份失败解决办法
随机推荐
MySQL executes alter table XX add column with duplicate entry error
Solution to connection rejected error in idea download sources
Solutions to sap Hana database backup failure
WARNING: Your password has expired.Password change required but no TTY available.
【Js】检查Date对象是否为Invalid Date
Use Preparedstatement to select and display recorded JDBC programs
rust猜数字游戏
Mysql操作
Create a flow using flow builder in kotlin
Do you dare to use BigDecimal without mastering these pits?
可视化机房管理
From Markov chain to GPT, Li Hang, director of ByteDance AI Lab, detailed the past and present lives of language models
Visual computer room management
LeetCode_ 455_ Distribute cookies
为啥一问 JVM 就 懵B ???
LeetCode_ Dynamic programming_ Medium_ 120. Triangle minimum path sum
From 5 seconds to 1 second, remember the performance optimization with "very" significant effect once
别再问我MySQL为啥没走索引?就这几种原因,全都告诉你
Mongodb group one piece of data in each group
从马尔可夫链到GPT,字节跳动AI Lab总监李航细说语言模型的前世今生