+ 1

how to connect php with mysql ?

if i want to connect php with mysql please guide

30th Jul 2016, 4:55 AM
Ankur Kumar
Ankur Kumar - avatar
4 Answers
+ 3
before you Connecticut. you havĂȘ to create tables mysqli_query($cn, "CREATE TABLE IF NOT EXISTS table ( id int(255) NOT NULL, PRIMARYKEY(id), )
1st Aug 2016, 3:21 PM
Sampaio Leal
Sampaio Leal - avatar
+ 2
if you speak about mysql use PDO connect, myslq_connect is deprecated. $bdd= new PDO("mysql:dbname=thedbname;host=ipServer", user, password);
4th Aug 2016, 9:15 AM
francis
+ 2
you need db first. then you need sql server name. username that is privileged to the database. username password. and table name. the syntax is all very simular but may differ slightly. are you using mysqli, mysql, pdo?
15th Aug 2016, 6:40 AM
Michael Fisher
Michael Fisher - avatar
+ 1
$cn=mysqli_connect(server,user ID,password,database); you have to create a database first and then perform the operations
30th Jul 2016, 6:46 AM
HITESH
HITESH - avatar