Hey there. I've created the following code.php :
<html>
<body>
<?php
$db_host = "localhost"; // Server - mySQL
$db_user = "user"; // Login - mySQL
$db_pass = "pass"; // Password - mySQL
$db = mysql_pconnect($db_host, $db_user, $db_pass) or die (mysql_error());
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM employees",$db);
printf("First Name: %s<br>\n", mysql_result($result,0,"first"));
printf("Last Name: %s<br>\n", mysql_result($result,0,"last"));
printf("Address: %s<br>\n", mysql_result($result,0,"address"));
printf("Position: %s<br>\n", mysql_result($result,0,"position"));
?>
</body>
</html>
The code works fine when i run it on my machine
http://localhost/code.php
My question is: I do have to upload the db I've created using mysql in my machine to my webserver to run the code there right? So how do I do it ? What file should I upload (db) to my webserver?
The localhost would be now http://www.server.com ??
I am asking this cause when I use asp I just have to upload the db.mdb but I saw that there are some other files inside
c:/apache/mysql/data/mydb such as employees.MYD,employees.MYI and employees(the db)
What should i change in my code to run at the webserver?
Thank you.