Jump to content

leszekj

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

leszekj's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I still have the problem and I do not have any idea what is wrong with the PHP code that cannot connect to the mySql server on my local computer. I changed the php.ini file, put the libmysql.dll into the Windows folder, I changed some other things in the php.ini and it does not work! It may be a small thing, and now I am considering the instructions in the php.ini file - whether they are correct. Should it be (I am using Windows XP): 1. doc_root = "C:\Program Files\Apache Group\Apache2\htdocs" or 2. doc_root = "C:/Program Files/Apache Group/Apache2/htdocs" or 3. doc_root = "C:\Program Files\Apache Group\Apache2\htdocs\" or 4. doc_root = "C:/Program Files/Apache Group/Apache2/htdocs/" The same with setting other directories: extension_dir = "c:\php\ext" extension_path = "c:\php\ext" (should I put this command?) Another thing is that the error may stick somewhere else. In the PHP configuration or in mySql itself? That is why I am giving here the screen of the result of the phpinfo(): [div align=\"center\"][img src=\"http://www.palacyk.lap.pl/report.gif\" border=\"0\" alt=\"IPB Image\" /][/div] I have tried to fix this problem all day long today but failed so far. I am still trying. I put my php.ini file [a href=\"http://www.palacyk.lap.pl/php.ini\" target=\"_blank\"]here[/a]. Oh, and I would forget to put the error reports that have appeared after my simple programme: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\u1.php on line 14 Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Group\Apache2\htdocs\u1.php on line 17 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\Program Files\Apache Group\Apache2\htdocs\u1.php on line 17 Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache2\htdocs\u1.php on line 19[/quote]
  2. After I restarted the computer the error showed: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\u1.php on line 14 So, still there is something wrong.
  3. No, I do not get an error reply. I have all - PHP, mySql and Apache locally installed on my computer. I installed all about two months ago, and the versions are from that time - the version of PHP is 5. I put these instructions into the php.ini file: extension=php_mssql.dll extension=php_msql.dll extension=php_mysql.dll and also I set: display_errors = On I does not work but I will try to restart the computer, and I will send a message. Thanks.
  4. I have mySql, PHP and the Apache server installed on my computer. The database mySql works OK, the PHP as well but when I want to connect to the database on my local computer it seems not to work. In my php I have the following code: <body> <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'cze00345'; echo 'check 1'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'test'; echo 'check 2'; mysql_select_db($dbname); echo 'check 3'; mysql_close($conn); ?> </body> The browser displays only "check 1", nothing more, so I suspect that there is something wrong with the "$conn=mysql_connect(..." instruction - it may not connect to the database. "root" and "cze00345" are the user and password I am using in the "mysql -h localhost -u root -p" instruction while reaching the database from the DOS window. I am wondering whether there is something more I should do in order to connect to the database via PHP.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.