Apache2Triad Help, Support and Development Forum Index Apache2Triad Help, Support and Development
The apache2triad help , support and development forums
 

MySQLi doesn't work
Click here to go to the original topic

 
       Apache2Triad Help, Support and Development Forum Index -> Programming
View previous topic :: View next topic  
Author Message
pixelzm



Joined: 01 Dec 2006
Posts: 3

Posted: Fri Dec 01, 2006 6:17 pm    Post subject: MySQLi doesn't work  

I install Apache2Triad v.1.5.4. with default settings.
When I work with MySQL with mysql functions everything is OK. But, mysqli functions doesn't work. I copy code from manuel and nothig (only white page in browser):
Code:
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

printf("Host information: %s\n", $mysqli->host_info);

/* close connection */
$mysqli->close();
?>


OR

Code:
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");

/* check connection */
if (!$link) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

printf("Host information: %s\n", mysqli_get_host_info($link));

/* close connection */
mysqli_close($link);
?>

Where I am wrong?
I was download some classes from internet and they doesn't work.

And, when I writing classes with construct

public function __construct(....) { }

this doesn't work too.

I think that everything from php5 doesn't work.



P>S> Sory for bad english.
Back to top  
Joshua Meadows (DemoRic)



Joined: 29 Dec 2004
Posts: 785
Location: S.E. Kansas

Posted: Fri Dec 01, 2006 8:26 pm    Post subject:  

Verify that you have the following lines in your c:\windows\php.ini

Quote: extension=php_mysql.dll
extension=php_mysqli.dll

After making those changes restart apache service.
Back to top  
pixelzm



Joined: 01 Dec 2006
Posts: 3

Posted: Fri Dec 01, 2006 10:42 pm    Post subject:  

Thanx.
I don't have second extension and I put it in php.ini.
What about __construct and classes?
Back to top  
Joshua Meadows (DemoRic)



Joined: 29 Dec 2004
Posts: 785
Location: S.E. Kansas

Posted: Fri Dec 01, 2006 11:27 pm    Post subject:  

The blank white page means there is an error in the code. You can view php's log files, or enable error output.

For example I use the following in my localhost virtual host, you can add it to an .htaccess to enable them in a per folder setting, or change these values in the php.ini Just remember that depending on where you put it you may give out error info to others.
Quote: php_value register_globals 0
php_value error_reporting 2047
php_value display_errors 1
Back to top  
pixelzm



Joined: 01 Dec 2006
Posts: 3

Posted: Fri Dec 01, 2006 11:55 pm    Post subject:  

Now working. I found error in my class. Thanx
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Programming
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.13 © 2001, 2002 phpBB Group