I would definitely recommend using
PHP to interface with MySQL. They actually integrate quite nicely. If you own the web server but don't have PHP installed, there are no worries... it's free and even runs on Windows! to connect to a MySQL database and retrieve information from it (I guess it's a little more confusing than I thought for someone just starting out), all you have to do is something like:
PHP Code:
<?php
// initial defines
$dbhost = 'db.host.name';
$dbusername = 'username';
$dbuserpassword = 'pass';
$default_dbname = 'default'
$default_sort_order = 'DESC';
$default_order_by = 'num';
$MYSQL_ERRNO = '';
$MYSQL_ERROR = '';
// connect function
function db_connect() {
global $dbhost, $dbusername, $dbuserpassword, $PHP_SELF, $default_dbname;
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
if(!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost.";
return 0;
}
// ...
// error handling functions here (omitted for length)
// ...
// the actual function to connect to the database
function database_connectivity() {
global $defaul_dbname, $default_tablename, $PHP_SELF, $view;
global $default_sort_order, $default_order_by, $posts_per_page;
global $sort_order, $order_by, $cur_page;
$link_id = db_connect($default_dbname);
if(!link_id) error_message(sql_error());
$order_by_str = "ORDER BY '$default_order_by'";
$sort_order_str = "DESC";
$query = "SELECT * FROM `$default_tablename`
$order_by_str $sort_order_str;
while($query_data = mysql_fetch_array($result)) {
$num = $query_data["num"];
$date = $query_data["date"];
$text = $query_data["text"];
...
}
echo (" ... ");
}
database_connectivity()
?>
If you have any questions regarding the language, the code, or life, the universe and everything, feel free to contact me.