You are here: Re: MySQL connect failure « PHP Programming Language « IT news, forums, messages
Re: MySQL connect failure

Posted by Erwin Moller on 03/20/07 15:11

Bruce A. Julseth wrote:

>
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:IamdnTLNMrgA02LYnZ2dnUVZ_oLinZ2d@comcast.com...
>> Bruce A. Julseth wrote:
>>> "Jeff" <jeff@quixion.net> wrote in message
>>> news:1174344779.712020.258000@p15g2000hsd.googlegroups.com...
>>>> Get rid of the @ in front of the $db = new mysqli( ...
>>>>
>>>> That is suppressing any errors on that line of code. Then it should
>>>> show you in your browser what the error is and then we can help you
>>>> further.
>>>>
>>>> Also, you can include $Database as the 4th parameter in your mysqli
>>>> constructor to connect to that specific database.
>>>>
>>>
>>> Okay, I now have
>>>
>>> $Host = "localhost";
>>> $User = "Fred";
>>> $Database = "house";
>>> $Password = "mypw"
>>>
>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
>>> .
>>> $Database;
>>>
>>> $db = new mysqli($Host, $User, $Password);
>>>
>>> echo "Connection is " . mysqli_connect_errno();
>>>
>>> I didn't add the database to the mysqli parameter list.
>>>
>>> I still never got to the 2nd echo statement. Firefox gives me a "done"
>>> in the lower left corner. The "mysqli" is the very first MySQL command I
>>> execute in my program. Do I need "Create" or "instantiate" something
>>> first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
>>> not sure what version. How can I find out?]
>>>
>>>
>>>
>>
>> Add this to the beginning of your script:
>>
>> error_reporting(E_ALL);
>> ini_set("display_errors", "1");
>>
>> And see what error messages you get. Or check your PHP error log (which
>> may be in the Apache log).
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstucklex@attglobal.net
>> ==================
>
> Adding the above code gave the error message:
>
> Fatal error: Class 'mysqli' not found in
> C:\Inetpub\wwwroot\SerenadeHOA\php\functions.php on line 47
>
> This implies to me that I have a configuration problem. What should I look
> for.
>
> My php.ini is in my C:\windows directory.:
> I have extension_dir = "c:/php5/ext"
>
> What else should I check?

search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.

Next thing to do is running phpinfo() and see if it finds and loads mysqli.

Good luck.

Regards,
Erwin Moller

>
> Thanks..

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация