Jump to content
The Uniform Server Community

Mysqli problems


SteveJ
 Share

Recommended Posts

Hello,

 

I am using Uniform Server 5-6-13. I am trying to use mysqli, but when I use the mysqli_connect command, my php web page does not render (blank page). It renders fine with mysql_connect. I looked in php.ini and my extension appears to be good:

 

extension=php_mysqli.dll with no semi-colon before it.

 

I ran my connect page (using mysql_connect) and this code:

 

$text = var_dump(function_exists('mysqli_connect'));

echo $text;

 

it printed to the page "bool(true)", which I understand means that mysqli does exist. I must be missing a setting somewhere. I hope you know where...

 

Thanks!

 

-Steve

Link to comment
Share on other sites

Hello,

 

I found my problem. When using mysqli, you must reverse the order of your parameters on mysqli_select_db (which is now only used when you want to change the database as the database is now declared in the connect function), and in the mysqli_query function. The proper orders are:

 

$con = mysqli_connect($host, $user, $pass, $database);

//mysqli_select_db($con, $database); use only if you want to change the default database

mysqli_query($con, $recordset);

 

-Steve

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...