Jump to content

Recommended Posts

You need to be a bit more specific about what isn't working. MySQL works automatically with Apache, sort of...

 

When you installed Apache, did PHPMyadmin install as well (check http://localhost/phpmyadmin if you installed this on your personal computer)?

 

If so, MySQL is already working! Just go to "Create Database" or similar to get started. PHPMyadmin docos are great too.

 

In order to code web pages which are viewed through Apache Server, and which use the MySQL DB for information, you need some connection info like

 


$host = "localhost";
$username = "fred";
$db = "test";
$password = "freddie";

$conn = mysql_connect($host, $username, $password) or die("Error connecting to database " . mysql_error());
mysql_select_db($db) or die("Error connecting to database " . mysql_error());

 

This is often stored in a file called "db.inc.php", then in each webpage you code, instead of repeating the connection info, you write (at the top in php) "require 'db.inc.php';"

 

Hope this helps

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.