lundi 5 janvier 2015

Sql Lite connection. Is it possible with Msqli procedural?

I have a project with MySQLi procedural and PHP. People ask me to make it work off line. I have been searching and I could find sql lite. I have installed it with MAMP. I have managed to create the same table that I have in MySql. Now I try to make the connection. I have google it and I could find ways to do it with PDO. It works well for me and I could apply it. But before going further I would like to be sure that there is no way to do that with MySQLi procedural (this would save me a lot of time and problems if I do not have to change everything to PDO).


So, my question: is it possible to use MySQLi procedural to make a connection with Sql Lite? If so, what would be the equivalent of this:



$con = mysqli_connect("localhost","root","root");
if (!$con) {
die('The connection with the server failed: ' . mysqli_error());
}

//Database name is : 'test'
if (!mysqli_select_db($con, 'test')){
echo "The connection with the database failed";
}


(this is where I have the sql lite database: /Applications/MAMP/db/sqlite/test I have a Mac, I have installed MAMP php lite Admin, and I am very new to all this. I have manage to do it alone, just with Google but I am not sure if I am going in the right direction. I have no experience. I would I appreciate any suggestion of someone with any experience )


Aucun commentaire:

Enregistrer un commentaire