With the rapid development of PHP, its functions are becoming more and more powerful. PDO (PHP Data Object) is a new thing in PHP 5. When PHP 6 is about to be released, PHP 6 will only use it by default. PDO handles databases and will move all database extensions to PECL. Then by default, our favorite php_mysql.dll will no longer exist. So what should we do? We can only keep pace with the times, so I gave it a try. Put PDO. (This article is only entry-level, experts can skip it, haha)
What is PHP PDO?
Installing PHP PDO
I am on Windows XP SP2, so the whole process is done on Windows. As for Linux/FreeBSD and other platforms, Please find the information and set up the installation by yourself.
Mine is PHP 5.1.4, which already comes with the php_pdo.dll extension, but it requires a little setup before it can be used.
Open c:windowsphp.ini, which is my PHP configuration file. Find the following line:
<ol class="dp-xml"><li class="alt"><span><span>extension_dir </span></span></li></ol>
This is the directory where our extension exists. My PHP 5 extension is in :C:php5ext, then I will change this line to:
<ol class="dp-xml"><li class="alt"><span><span class="attribute"><font color="#ff0000">extension_dir</font></span><span> = </span><span class="attribute-value"><font color="#0000ff">"C:/php5/ext"</font></span><span> </span></span></li></ol>
Then go to php.ini and find:
<ol class="dp-xml"><li class="alt"><span><span>Dynamic Extensions ; </span></span></li></ol>
There are a bunch of similar;extension below =php_mbstring.dll, here is the configuration of PHP extension loading, we will add our PDO extension at the end:
<ol class="dp-xml"> <li class="alt"><span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo</font></span><span>.dll </span></span></li> <li class=""> <span></span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_mysql</font></span><span>.dll </span> </li> <li class="alt"> <span></span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_pgsql</font></span><span>.dll </span> </li> <li class=""> <span></span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_sqlite</font></span><span>.dll </span> </li> <li class="alt"> <span></span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_mssql</font></span><span>.dll </span> </li> <li class=""> <span></span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_odbc</font></span><span>.dll </span> </li> <li class="alt"> <span></span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_firebird</font></span><span>.dll </span> </li> <li class=""> <span>;</span><span class="attribute"><font color="#ff0000">extension</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">php_pdo_oci8</font></span><span>.dll </span> </li> </ol>
Various PHP PDO drivers, all that can be added are provided In addition, the following php_pdo_oci8.dll, because I have not installed the Oralce database, does not have this, so I use a semicolon to comment it out. Then restart our web server, IIS/Apache, mine is IIS, hey, you look down on me, on Windows, it’s easy.
After restarting, write a phpinfo.php file in the document directory of our web server, add these:
<ol class="dp-xml"> <li class="alt"><span><span><? </span></span></li> <li class=""><span>phpinfo(); </span></li> <li class="alt"><span>?> </span></li> </ol>
Then open our lovely browser: IE/FireFox, Mine is FireFox 2.0, I just downloaded it, it’s great, I’m not afraid of rogue software, haha. Enter: http://localhost/phpinfo.php in the browser. If your path to this page is inconsistent, please enter it yourself. In the output content, if you can successfully see:
<ol class="dp-xml"> <li class="alt"><span><span>PDO </span></span></li> <li class=""><span>PDO support enabled </span></li> <li class="alt"><span>PDO drivers mysql, pgsql, sqlite, mssql, odbc, firebird </span></li> </ol>
followed by various driver instructions: PDO_Firebird, pdo_mssql, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, then congratulations on your successful installation, otherwise Please check the steps above carefully

作为一名Java开发者,学习和使用Spring框架已经是一项必不可少的技能。而随着云计算和微服务的盛行,学习和使用SpringCloud成为了另一个必须要掌握的技能。SpringCloud是一个基于SpringBoot的用于快速构建分布式系统的开发工具集。它为开发者提供了一系列的组件,包括服务注册与发现、配置中心、负载均衡和断路器等,使得开发者在构建微

近日,努比亚Z70Ultra在IMEI数据库中现身,型号为NX731J。该手机搭载了新一代屏下摄像头技术,将成为全球首款搭载骁龙8Gen4处理器的真全面屏旗舰手机,该手机最大的亮点是采用了1.5K分辨率的屏下摄像头方案,这是目前行业内分辨率最高的UDC(屏下摄像头)技术。此前努比亚已量产第六代屏下摄像技术(屏幕分辨率为2480×1116,介于FHD和1.5K分辨率之间),而Z70Ultra的屏幕分辨率提升至1.5K,实现了无刘海、无挖孔的真全面屏设计。1.Z70Ultra搭载一英寸超大底主摄传感

win7系统自带有备份还原系统的功能,如果之前有给win7系统备份的话,当电脑出现系统故障的时候,我们可以尝试通过win7还原系统修复。那么win7怎么还原系统呢?下面小编就教下大家如何还原win7系统。具体的步骤如下:1、开机在进入Windows系统启动画面之前按下F8键,然后出现系统启动菜单,选择安全模式登陆即可进入。2、进入安全模式之后,点击“开始”→“所有程序”→“附件”→“系统工具”→“系统还原”。3、最后只要选择最近手动设置过的还原点以及其他自动的还原点都可以,但是最好下一步之前点击

随着Web应用程序的需求越来越高,PHP技术在开发领域中变得越来越重要。在PHP开发方面,测试是一个必要的步骤,它可以帮助开发者确保他们创建的代码在各种情况下都可靠和实用。在PHP中,一个流行的测试框架是PHPUnit。PHPUnit是一个基于Junit的测试框架,其目的是创建高质量、可维护和可重复的代码。下面是一些学习使用PHPUnit框架的基础知识和步骤

荣耀MagicBookPro14惊艳发布,引领AIPC新时代!在MWC开幕前夕,荣耀抢先在国内发布了全新MagicBookPro14笔记本,并同步推出AIPC2.0战略,以AI技术全面革新笔记本电脑体验。荣耀AIPC2.0战略涵盖AI内核驱动的智能硬件、AI智能体赋能的人机交互以及AI服务流转的跨端生态。荣耀手机广受好评的“一句话的事”AI交互体验也将在MagicBookPro14上实现,用户只需语音指令即可完成操作。搭载全新HONORTurboX技术,MagicBo

香港中文大学(深圳)吴保元教授课题组和浙江大学秦湛教授课题组联合发表了一篇后门防御领域的文章,已顺利被ICLR2022接收。近年来,后门问题受到人们的广泛关注。随着后门攻击的不断提出,提出针对一般化后门攻击的防御方法变得愈加困难。该论文提出了一个基于分割后门训练过程的后门防御方法。本文揭示了后门攻击就是一个将后门投影到特征空间的端到端监督训练方法。在此基础上,本文分割训练过程来避免后门攻击。该方法与其他后门防御方法进行了对比实验,证明了该方法的有效性。收录会议:ICLR2022文章链接:http

随着win10系统的成熟,微软停止win7的更新和支持,越来越多人选择win10系统使用,打算将自己的win7升级win10系统。不过很多小伙伴不知道win7如何升级win10系统,找不到升级的按键。下面小编教大家一个简单的win7升级win10系统的方法。我们可以借助工具轻松实现win7升级安装win10的方法,具体的操作步骤如下:1、先在电脑上下载安装小鱼一键重装系统工具并打开,关闭电脑的杀毒软件,备份c盘重要资料。然后选择需要安装的win10系统点击安装此系统。2、这个界面选择想要安装的软

Laravel是一个基于PHP的开源Web应用程序框架,是当今最受欢迎的框架之一。它的设计思想是以简单、优雅的方式解决复杂的问题,为开发Web应用程序提供了丰富的工具和资源。如果你想在PHP中学习Laravel框架,下面是几个关键步骤:第一步:安装和配置Laravel在开始使用Laravel之前,您需要安装PHP和Composer。Composer是一个PH


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
