Go to Post However, it is logistically impossible, so it's now just a joke. - EricH [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2003, 10:39
steveg's Avatar
steveg steveg is offline
Livin' the Dream
AKA: Stephen Guerrera
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Boston, MA
Posts: 70
steveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to beholdsteveg is a splendid one to behold
Send a message via AIM to steveg
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_iderror_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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Parsing Jack FIRST Scouting Network 1 12-10-2003 13:36
XML And Link Raven_Writer Website Design/Showcase 13 26-09-2003 17:24
xml Jack FIRST Scouting Network 0 01-09-2003 16:23
Message Boards w/o MySQL iBob Website Design/Showcase 7 13-07-2003 02:00
MySQL query question Jack Website Design/Showcase 9 02-02-2003 00:11


All times are GMT -5. The time now is 00:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi