PHP PDO Prepared Statements Tutorial

preview_player
Показать описание
Learn to create PDO Prepared Statements and quickly discover its key benefits. In the very next video tutorial you can learn to create prepared statements using mysqli. Prepared statements work for Both the PDO and mysqli extensions in PHP.
Рекомендации по теме
Комментарии
Автор

This channel and your site are life savers my deepest thanks.

ArturoN
Автор

Excellent video! Short and to the point. Thanks!

stephenpeters
Автор

Thank you! Your tutorials are always awesome!

outterWorld
Автор

Hi great vid, im stuck tryin to make this do an update based on an id of a previous select pdo which the 1st works and the update doesn’t do its job can you please a tut using update please?

Автор

hollo, have any idea what can cause this?

PHP Fatal error: Uncaught Error: Call to a member function prepare() on null

foreign-livingtheamericand
Автор

Hi, I'm trying to do the next:
$bbw = new
* from menu where nivel=:idnivel");
$consulta->bindParam(":idnivel", $idnivel, PDO::PARAM_INT);
$idnivel=1;
$consulta->execute();

and then I try to prepare another query:


* from factura where idusuario=:idusuario ");
$consulta->bindParam(":idusuario", $idusuario, PDO::PARAM_INT);
$idusuario=40;
$consulta->execute();

All in the same php script but it doesn't work, what Am I doing wrong?

oscarjoserodriguezalfaro
Автор

ok, so i'm a bit new to
why is this needed for a website?
and in what can i use this?

xerrn
Автор

What music is that? Been searching for it :D

hanif
Автор

When i use this code my form dissapears from my HTML PAGE!. I use a $user->function that sends the POST info to the public function insert.

public function Insert ($post_geslacht, $post_voornaam, $post_voorletters, $post_tussenvoegsel, $post_achternaam, $post_email, $post_vooropleiding, $post_afstudeerjaar) {

$stmt = $db->prepare("INSERT INTO brochure (geslacht, voornaam, voorletters, tussenvoegsel, achternaam, email, vooropleiding, afstudeerjaar) VALUES (:geslacht, :voornaam, :voorletters, :tussenvoegsel, :achternaam, :email, :vooropleiding, :afstudeerjaar)");

$stmt->bindParam(':geslacht', $post_$geslacht);
$stmt->bindParam(':voornaam', $post_voornaam);
$stmt->bindParam(':voorletters', $post_voorletters);
$stmt->bindParam(':tussenvoegsel', $post_tussenvoegsel);
$stmt->bindParam(':achternaam', $post_achternaam);
$stmt->bindParam(':email', $post_email);
$stmt->bindParam(':vooropleiding', $post_vooropleiding);
$stmt->bindParam(':afstudeerjaar', $post_afstudeerjaar);
$stmt->execute();

echo "Prepared statements have been executed";
$db = null;
}

MaguumaTV
Автор

thx bro <3
Other method without using class::bindparam and class::prepare but this method is dangerous because the mysql injection can access with data .
$sql= 'INSERT INTO people SET username= " '.$username.' ", gender=" '.$gender.' ", country=" '.$country.' " ';
$db->exec($sql);

uosif_heikal
Автор

hi adams. u are my world best. pls can you give a tutorial on how to create a document in php that can be read in ms-word or pdf. Adam i need a tutorial on this because almost every day i prepare over 20 letters to client in ms-word with the same content but dynamic client name and address on the company letter head.

umagbaalex
Автор

how to make captcha validation with session in php

praveenkumar_Creatives