Jump to content


Photo

Mysqli problems


  • Please log in to reply
1 reply to this topic

#1 SteveJ

SteveJ

    Newbie

  • Member
  • Pip
  • 9 posts
  • Gender:Male
  • Main OS: Windows 7

Posted 25 October 2012 - 02:33 PM

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

#2 SteveJ

SteveJ

    Newbie

  • Member
  • Pip
  • 9 posts
  • Gender:Male
  • Main OS: Windows 7

Posted 25 October 2012 - 08:37 PM

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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users