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: 783
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: 783
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  
davidbeckam



Joined: 23 Jun 2009
Posts: 1

Posted: Wed Jun 24, 2009 10:41 am    Post subject: mysql questions  

I've got a system that needs mysql running on it, i am using zfs.
It's running 7.2 current.

I was wondering if the zfs best practices guide applies to freebsd as well, i understand that it was originally written for opensolaris.

My main concern is this: I have a few sites with mysql databases, none of them are especially LARGE yet but they do get used often. Right now i'm running it with all default settings. I'd like to tune it some because i'm getting some lag and i'm pretty sure it's due to the database. All of my databases are currently myisam.

According to the opensolaris tuning guide i should set max ARC lower and set the zfs record size to match the mysql block size.

Is there anything else i need to do? does this still hold true for freebsd? i can't find a lot of information on mysql + zfs + freebsd. Also, does it matter than i run everything on one machine (mysql, apache and php)

thanks for any help.



web development services
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