I'm new to MySQL, phpMyAdmin, etc. I was told that I need to create a database on both my computer and online (through my C-Panel), then use phpMyAdmin to import MySQL tables from my computer.
So I created a MySQL database through my C-Panel and accessed C-Panel - but I can't find any reference to "Import," though there is an Export function.
And if I can tack on another question or two, do the databses and tables on your computer and online have to have the exact same names, usernames, passwords, etc.?
Below is the code from a MySQL table I inserted on a web page with Dreamweaver:
[PHP]
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM employees",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "<table border=1>\n";
echo "<tr><td>Name</td><td>Position</td></tr>\n";
do {
printf("<tr><td>%s %s</td><td>%s</tr>\n", $myrow["first"], $myrow["last"], $myrow["address"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}
?>
[/PHP]
If I publish this page online, and I already have a copy of my MySQL database/table online, then I assume this code...
$db = mysql_connect("localhost", "root");
won't work unless the values "localhost" and "root" are the same online. Plus, I assume I also have to plug in my username and password somehow.
So I guess I answered my own question, but I just wanted to make sure. I'm assuming everything online has to be a carbon copy of everything on my computer - same web page, same database and table, same usernames and passwords, same Dreamweaver database connections.
Is this correct?
Thanks.


