Jump to content

Quick Problem


Inflict

Recommended Posts

Hi, I tried the following in a .php file:

 

<HTML> 
<HEAD> 
<TITLE> 
PHP Testing 
</TITLE> 
</HEAD> 
<BODY> 
<font size="1" face="Verdana"> 
<?php 
$mysqli = mysqli("localhost", "localuser", "localpass", "database"); 
if (mysqli_connect_errno()) { 
printf("Connect failed: %s\n", mysqli_connect_error()); 
exit(); 
} else { 
printf("Host information: %s\n", mysqli_get_host_info($mysqli)); 
} 
?> 
</font> 
</BODY> 
</HTML>

 

I did this to check if mySQL was functioning correctly with PHP. The problem is that when I load the .php file in Internet Explorer, the page shows up blank. The problem seems to be from the line $mysqli = mysqli("localhost", "localuser", "localpass", "database"); which used the mysqli(); function. When I view the source code for the web page, it shows everything after and including the line $mysqli = mysqli("localhost", "localuser", "localpass", "database"); blank. I recently installed mysqli by allowing its extension in the php.ini file and restarting the server. I am using MySQL 5.0 with PHP 5.2.1 and Apache HTTP Server 2.2.4 on Vista Ultimate. PHP seems to be working as I did some forms with it and also tested the phpinfo(); function. Perhaps I did not install mysqli correctly? I don't know what to do and I'm in shambles. I've been researching this all day. Can anyone help me?

Link to comment
https://forums.phpfreaks.com/topic/47645-quick-problem/
Share on other sites

Apache's error log reports: [Wed Apr 18 19:00:31 2007] [error] [client 127.0.0.1] PHP Fatal error:  Class 'mysqli' not found in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\mysqlconnect.php on line 10, and by the way, like 10 is $mysqli = mysqli("localhost", "localuser", "localpass", "database");

 

Someone please help me!

Link to comment
https://forums.phpfreaks.com/topic/47645-quick-problem/#findComment-232719
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.