PHP and MySQL with MySQLi: Connecting (Part 3/9)

preview_player
Показать описание

Official site

Twitter
Рекомендации по теме
Комментарии
Автор

Thanks for all the videos.
To me they are greatly helped.

Please create a video about MySQL vs PDO.

And try to catch executing query.

How to view the prepared SQL after "PREPARE"?

Andris_Briedis
Автор

The browser always stays blank no matter what I do, any help?

lakitu
Автор

Why is this included in the PDO series?  it seems odd that we go through PDO connections in the early videos and then suddenly we are back using MYSQLi

Explanation and quality of tutorials is amazing as always of cause just curious why the change over.

JaxCavalera
Автор

Grate tutorial, i can't know good in english, but your video is fully understandy for me, grate video :)

Автор

To the ones that have problems connecting to the database, here it's the PDo version:

$dsn =
$user = 'root';
$password = 'root';

try {
$db = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}

nelsonparreira
Автор

Can you please tell me which sublime theme you are using?

MyWorldiskewL
Автор

why did you make an object of can use mysqli_connect function as well

mquanit
Автор

Haven't you already done a tutorial on this?

demoScript
Автор

Hi Alex, when you use the "$db->connect_errno" on the if statment, it supposed to return 0 (zero) if there isnt no error
So why the if statment work ? zero means false am i right ?
i didn't ready understand why not to use the ! (not) mark...

tal
Автор

Can anyone tell me the path in ubuntu where i should be having the index and connect php files ? i have created my own folder in desktop and did what's required . but then it's not working.
Thank you in advance

kazishahrukhomar
Автор

Don't you write require function in PHP under the brackets? Like this :- require('config.php');

thunder-fire
Автор

this is great! but please tell us where to store the folders/the folder structure. For anyone wondering, it's in your localhost then just index, then with another folder of 'db' and inside 'db' is connect.php :)

champo
Автор

Parse error: syntax error, unexpected 'echo' (T_ECHO) in on line 13 echo $db->connect_errnon;

us
Автор

He did a tutorial on PDO, Yes Mysqli and PDO are simular as in the same design, But MySQLi Utilizes all the MySQL API.

tagKnife
Автор

what is the difference of mysqli_errno() and $db->connect_errno.?

angkolmer
Автор

what is the difference of mysqli_connect() and new mysqli() ?

RandomHook
Автор

dont you need to download mysqli before unsing its functions?

NoamShvacher
Автор

Just did some searching, PDO is better of course. Totally forgot that PDO supports over 12 different Database types. It also supports some other stuff mysqli can't handle.

Автор

I am using XAMP, Sublime 2 and have the index.php and db/connect.php  docs saved in a folder on my desktop.

FoxStv
Автор

This is the object oriented way of connecting to the database. People who are watching this tutorial are most likely looking for a procedural way...

kalekip