当前位置:网站首页>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();
}
?>
边栏推荐
- @Bean 注解的方法调用多次会创建多个bean 实例吗
- Trust sums two numbers
- 训练和测试的loss不下降,并且精度超低
- Record the range of data that MySQL update will lock
- Trust counts the number of occurrences of words in the file
- TwinCAT 3 first run error 4115
- Debug:形参带有Const修饰符号需要注意的地方
- MongoDB分组取每组中一条数据
- The larger the convolution kernel, the stronger the performance? An interpretation of replknet model
- The use method of quota command is expanded in detail, and the carrying method of quota command in RHEL 7! Disk capacity quota!
猜你喜欢

Redis分布式锁,没它真不行

Food safety eating preserved eggs will lead poisoning? Don't worry about eating after knowing these points

乘风破浪!金融科技时代下的数字化转型之路

你真的了解Redis的持久化机制吗?

MySQL六十六问,两万字+五十图详解含(答案解析)

xlinx pcie xvc

@Will multiple bean instances be created by multiple method calls of bean annotations

作为一名后台开发人员,你必须知道的两种过滤器

MySQL大量写入问题优化方案 MySQL参数调优

Don't ask me again why MySQL hasn't left the index? For these reasons, I'll tell you all
随机推荐
别再问我MySQL为啥没走索引?就这几种原因,全都告诉你
[operation] Yan Yi (Internet new technology operation)
LeetCode_455_分发饼干
深拷贝deepClone的实现
sublime text使用技巧
IDEA Download Sources报错 Connection refused的解决方法
topology.yaml中指定端口号
WSUS can patch MySQL Middleware_ Join the WSUS patch server and download the patch
vim 笔记
可视化机房管理
Rust中的函数function与方法method的区别
The difference between try catch and if else statements in PHP
12 pictures +6k figure ZGC garbage collector and tuning skills
LeetCode_724_寻找数组的中心下标
Emgu cv3+c # image processing (IV): use emgucv to obtain camera and read video
工业物联网中的时序数据
你真的了解Redis的持久化机制吗?
面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
An online frequent fullgc troubleshooting
深入理解机械系统的模态与振动