Jump to content

Recommended Posts

I have installed mysql and php5 in my machine. mysql server is running. Apache is also running. normal page displayed correctly with following code.

<html>

<head>

"Heading"

</head>

<body>

<?php

  echo "Hi this php";

 

  $dbcnx = @mysql_connect('localhost', 'root', 'winman') or die("d");

  mysql_select_db("winmannodb") or die("<b>could not select database</b>.");

?>

</body>

</html>

 

 

the word 'hi this is php' comes in the browser but no message for mysql connection even if database is given wrong which is not there in the mysql server. pls advice.

 

thanking u

Link to comment
https://forums.phpfreaks.com/topic/78356-could-not-connect-to-mysql/
Share on other sites

Try like this, your echo will run cause it has nothing to do with mysql connection

<?php
error_reporting(E_ALL);
echo "Hi this php";

  $dbcnx = mysql_connect('localhost', 'root', 'winman') or die("d");
  mysql_select_db("winmannodb") or die("could not select database.");
?>
<html>
<head>
"Heading"
</head>
<body>
</body>
</html>

 

In php.ini see if this line is uncommented

extension=php_mysql.dll

 

 

go into your PHP directory..find

 

libmysql.dll

libmysqli.dll

 

and copy them to your windows system32 folder

restart apache and check your php info page

 

ie

<?php

echo phpinfo();

?>

 

Mysql should appear ...hopefully

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.