Jump to content

Mysqli to mysql


cloudy243

Recommended Posts

Hey i always use mysqli queries, but my new server doesnt work with mysqli. I am having to change to use mysql in a lot of my scripts. Previously i would use something like

 

$con = mysqli_connect($mysqlServer, $mysqlUser, $mysqlPass, $mysqlDatabase) or die ("Site Not Setup");

$sql = "SELECT * FROM posts";

$result = mysqli_query($con, $sql) or die ("Query failed: getNumPosts");

 

Am i able to do this same thing with mysql, ex:

 

$con = mysql_connect($mysqlServer, $mysqlUser, $mysqlPass, $mysqlDatabase) or die ("Site Not Setup");

$sql = "SELECT * FROM posts";

$result = mysql_query($con, $sql) or die ("Query failed: getNumPosts");

Link to comment
https://forums.phpfreaks.com/topic/189242-mysqli-to-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.