You are here: Re: Need help with PHP / MySQL connect problem « PHP « IT news, forums, messages
Re: Need help with PHP / MySQL connect problem

Posted by Linda H on 07/18/05 05:08

Thanks for the advice, Matt, but it doesn't seem to solve my problem.

php.ini is in the C:Program Files/WINDOWS directory and error_reporting was
set to E_ALL.

I found php5ts.dll in the WINDOWS/system32 directory. I copied it to
WINDOWS/system, just in case. My install instructions said to put it with
my other dlls, which might be in either directory. Most of them are in
system32.

>Using this at the top of your script will allow PHP and MySQL to interact.
>$_POST['dbconn']=mysql_select_db("database_name",
>mysql_connect("server_name","user_name","password"));

I put this in my script (changing parameters as appropriate) but got no
results and no error messages. Any other ideas. I've spent hours on this,
trying everything I could think of and I'm very frustrated.

The rest of my output is still suppressed if I put the connect script above
it in the file.

>It does sound like you have notices and warnings turned off in php.ini:
>Find php.ini (not sure where it installs to in Windows version), and set
>error_reporting = E_ALL.
>This will show all notices and warnings generated by your PHP code;
>extremely usefull in debugging.
>
>Matt Darby
>
>Linda H wrote:
>
>>I'm running MySQL 4.0.21, Apache 2.0.52 and PHP 5.0.2 on a Windows XP
>>system. I can run scripts with PHP and HTML statements and see correct
>>output in my browser. But when I try to connect to MySQL I get nothing,
>>including no error messages.
>>
>>One book I have says to run the following scrip to test the connection.
>>It should print either the Resource name or an error message:
>>
>><?php
>> echo mysql_connect ('localhost','calendar','pass1234'); # host, user,
>> password
>>?>
>>
>>I get no output at all, and if the statement is placed in a larger
>>script, above html/PHP output, it suppresses that as well.
>>
>>Using the mysql monitor from the DOS command prompt, I can connect as
>>user 'calendar' with password 'pass1234', select a database and execute
>>SQL statements successfully.

 

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

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