This question already has an answer here:
- MySQL vs MySQLi when using PHP [closed] 6 answers
Aaalright, i really need some help to this, because im really confused. Im trying to connect to a database on phpmyadmin.
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('test_database');
?>
Here im using "mysql_connect". When i run it, it says that this extension deprecated/outdated and that i have to use "mysqli_connect".
So now i'm just using the same code as above, but just with the "i" at the end instead.
What am I doing wrong?
In advance, thanks!
PS: My first language is NOT english. Hope you will understand it.
mysqli_select_db parameters are different. Read their documentation: http://us3.php.net/manual/en/mysqli.select-db.php
Php has changed to mysqli, so you will have to use mysqli instead of mysql. In mysqli, you don't just add an i and it's done. Read this for all the mysqli functions http://php.net/manual/en/book.mysqli.php
ex. of mysqli query^^
You are using
mysql_connect
.You must replace it withmysql_connect
and learn about its functions.This link would be a nice read