Let's say a have a database of articles. I know how to connect to the database server and select the database, or at least I think i do:
include("connect.php");
$connection = @mysql_connect($hostname, $username, $password, $dbname);
if (!$connection) {
echo( "Unable to connect to the database server.");
exit();
}
mysql_select_db("articles", $connection);
if (! @mysql_select_db("articles") ) {
echo( "Unable to query the database");
exit();
}
...but how do I take one row from the table, and insert each of the various columns of that row into a variable? Columns will be somthing like: ID, Author, AuthorName, AuthorEmail, Article.
I've yet to switch my host, so I havn't been able to experiment with a database or PHP. Thanks in advance.





Bookmarks