* Preprocess update data
//1. Connect to the database and create the pdo object
try { $pdo = new PDO('mysql:dbname=php','root','root'); } catch (PDOException $e) { exit($e->getMessage()); }
//2. Prepare the sql statement
$sql = "UPDATE user SET email=:email WHERE user_id=:user_id";
//3. Create Preprocessing object stmt object
if($stmt = $pdo->prepare($sql)) {
//4. Bind parameters to stmt object and execute
//Prepare parameters
$param = ['email'=>'lwt@qq.com','user_id'=>5]; //绑定参数到SQL语句对象并执行 if ($stmt -> execute($param)){ //rowCount()返回更新的数量,如果大于0表示有记录被更新啦 if ($stmt->rowCount()>0) { echo '成功更新了'.$stmt->rowCount().'条记录'; } else { //等于0表示没有记录被更新 echo '没有记录被更新'; } } else { //执行失败的信息 print_r($stmt->errorInfo()); exit(); } } else { //$stmt语句对象创建失败 print_r($pdo->errorInfo()); exit(); }

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Atom editor mac version download
The most popular open source editor

Dreamweaver CS6
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.
