From: "sueandant" on 6 Oct 2010 16:48 Yes, I've run phpinfo() and mysqli is listed in the detailed output. ----- Original Message ----- From: "Jay Blanchard" <jblanchard(a)pocket.com> To: "sueandant" <hollandsathome(a)tiscali.co.uk>; <sstaples(a)mnsi.net> Cc: "PHP" <php-general(a)lists.php.net> Sent: Wednesday, October 06, 2010 9:31 PM Subject: RE: [PHP] Class mysqli not found [snip] When I run this small program I get a Fatal Error: Class mysqli not found error message. [/snip] Have you run a simple phpinfo(); to see if you have the mysqli module?
From: "sueandant" on 6 Oct 2010 16:49 I've tried this and get the same error message. ----- Original Message ----- From: "Alejandro Michelin Salomon" <amichelins(a)hotmail.com> To: "'sueandant'" <hollandsathome(a)tiscali.co.uk> Cc: <php-general(a)lists.php.net> Sent: Wednesday, October 06, 2010 9:33 PM Subject: RES: [PHP] Class mysqli not found Sueandant : mysqli is set of functions not a class. The name to connect is mysqli_connect /** * * * @version $Id$ * @copyright 2010 */ $mysqli = mysqli_connect ("localhost", "root", "woodcote", "testDB"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { printf("Host information: %s\n", mysqli_get_host_info($mysqli)); } Try adodb lib for php ( http://adodb.sourceforge.net/ ), is great layer on top of php db functions. Alejandro M.S. -----Mensagem original----- De: sueandant [mailto:hollandsathome(a)tiscali.co.uk] Enviada em: quarta-feira, 6 de outubro de 2010 17:27 Para: sstaples(a)mnsi.net Cc: PHP Assunto: Re: [PHP] Class mysqli not found Thanks Steve. Here's the php file: <?php /** * * * @version $Id$ * @copyright 2010 */ $mysqli = new mysqli("localhost", "root", "woodcote", "testDB"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { printf("Host information: %s\n", mysqli_get_host_info($mysqli)); } ?> When I run this small program I get a Fatal Error: Class mysqli not found error message. ----- Original Message ----- From: "Steve Staples" <sstaples(a)mnsi.net> To: "sueandant" <hollandsathome(a)tiscali.co.uk> Cc: "PHP" <php-general(a)lists.php.net> Sent: Wednesday, October 06, 2010 9:09 PM Subject: Re: [PHP] Class mysqli not found > On Wed, 2010-10-06 at 21:00 +0100, sueandant wrote: >> I'm still fighting a losing battle in my attempts to get PHP speak to >> mysqli. I can access MySql via the prompt. Apache and PHP are installed >> and working. In Apache's config file PHPIniDir is set to "C:\php", >> which is where I unzipped the binary download files, and set LoadModule >> php5_module C:\php\php5apache2_2.dll. In php.ini I have uncommented the >> mysql.dll and mysqli.dll extensions and set extension_dir = >> "C:\php\ext\". I have edited the environment variables to include >> C:\php and C:php\ext. >> >> I am running Vista Home Premium 32 bit with SP2, Apache 2.2, PHP 5.3.3 >> and MySql Server 5.1. >> >> What have I missed? > > How are you connecting to the mysql? What does your connection string > look like from your php file? Can you cut and paste it here for us to > trouble shoot (if it is the apache->php->mysql connection problem) > > > Steve > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
From: "Tommy Pham" on 6 Oct 2010 19:36
> -----Original Message----- > From: chris h [mailto:chris404(a)gmail.com] > Sent: Wednesday, October 06, 2010 1:44 PM > To: Alejandro Michelin Salomon > Cc: sueandant; php-general(a)lists.php.net > Subject: Re: [PHP] Class mysqli not found > > mysqli is set of functions not a class. The name to connect is mysqli_connect > > > mysqli can be used as either a set of functions ( mysqli_connect(..) ) OR it > can be used an an object ( new mysqli(...) ). When used as an object you > just use the various functions as methods. > > http://www.php.net/manual/en/mysqli.connect.php > > > Chris. > Correction: mysqli extension can be implemented as either procedural via functions or as class objects via $mysqli = new mysqli('localhost', 'my_user', 'my_password', 'my_db'); Regards, Tommy |