Re: [PHP-DB] PostgreSQL and HTML output

2002-10-18 Thread Maarten Verheijen
Dear Robertson,

Try something like this with a simple table, create it like this in mysql:

CREATE TABLE HITS (
IDNR INTEGER AUTO_INCREMENT PRIMARY KEY,
REFFER VARCHAR(255),
HIT_DATE TIMESTAMP(8)
);


And the as a .php file, try something like this:
-

html
headtitleSimple outputpage for a MySQL-query/title/head
body bgcolor=#FF  text=#00
table width=100%

?
// Let's start the database-connection
mysql_connect('your_hostname','your_username','your_password') or
die(Unable to connect to the SQL server...);
mysql_select_db(your_database_name);


// The query
$SQL_QUESTION = select REFFER,HIT_DATE  from HITS;
$SQL_QUERY = mysql_query( $SQL_QUESTION );


// Let's go with the query and build the table
while ($row=mysql_fetch_array($SQL_QUERY)) {
echo 'tr';
echo 'td'; echo $row[REFFER]; echo '/td';
echo 'td'; echo $row[HIT_DATE]; echo '/td';
echo '/tr';
}
?

/table
/body
/html

--

If none of this makes any sense to you please start at the beginning,
Try http://www.devshed.com for some excellent tutorials.

Good Luck,
Maarten Verheijen





- Original Message -
From: Edwin Robertson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, October 18, 2002 7:02 PM
Subject: [PHP-DB] PostgreSQL and HTML output


 With psql you can get all your output in HTML format.  Anyone know of a
way
 to do this in PHP?



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] PostgreSQL and HTML output

2002-10-18 Thread Edwin Robertson
With psql you can get all your output in HTML format.  Anyone know of a way
to do this in PHP?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] PostgreSQL and HTML output

2002-10-18 Thread Jason Wong
On Saturday 19 October 2002 01:02, Edwin Robertson wrote:
 With psql you can get all your output in HTML format.  Anyone know of a way
 to do this in PHP?

The usual way is to write some code to do it.

If you don't want to write your own code search for some ready-made ones, 
ADOdb springs to mind.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
No matter where I go, the place is always called here.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php