[Phpsig] Issue with web page display of MySQL values

randall perry phpsig@kalamazoolinux.org
Thu, 12 Sep 2002 13:08:44 -0200


--=======33D566BE=======
Content-Type: text/plain; x-avg-checked=avg-ok-766045B1; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

I was helping a student with a project, and I am near the end of my 
expertise on PHP and MySQL (the class was on neither).  I gave him some 
code and helped him make the initial site, but now he is looking to improve 
it, and I am not much help here.

Take a look:
http://www.domain-logic.com/class/Davenport/cis241/view.php

Device Type and Site should pull up their respective links in this view and 
not their numbers.
Here is the database schema:

mysql> show tables;
+---------------------+
| Tables_in_ipaddress |
+---------------------+
| device              |
| ipaddress           |
| site                |
+---------------------+


mysql> describe device;
+----------+-------------+------+-----+---------+----------------+
| Field    | Type        | Null | Key | Default | Extra          |
+----------+-------------+------+-----+---------+----------------+
| devtype  | varchar(15) |      | UNI |         |                |
| typecode | smallint(6) |      | PRI | NULL    | auto_increment |
+----------+-------------+------+-----+---------+----------------+
2 rows in set (0.00 sec)

mysql> describe ipaddress;
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| ip_add   | varchar(15) |      | PRI | 0.0.0.0 |       |
| ufname   | varchar(30) | YES  |     | NULL    |       |
| ulname   | varchar(30) | YES  |     | NULL    |       |
| devname  | varchar(30) | YES  |     | NULL    |       |
| typecode | smallint(6) | YES  |     | NULL    |       |
| siteid   | smallint(6) | YES  |     | NULL    |       |
| appl     | varchar(35) | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+
7 rows in set (0.00 sec)

mysql> describe site;
+-----------+-------------+------+-----+---------+----------------+
| Field     | Type        | Null | Key | Default | Extra          |
+-----------+-------------+------+-----+---------+----------------+
| site_name | varchar(40) |      | UNI |         |                |
| siteid    | smallint(6) |      | PRI | NULL    | auto_increment |
+-----------+-------------+------+-----+---------+----------------+
2 rows in set (0.00 sec)

I also made some links to the source code.  Hey Paul! Take a look and maybe 
learn something (or maybe you are already past this?)
Randall Perry
www.fasnap.com
www.Davenport.edu

--=======33D566BE=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-766045B1
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002

--=======33D566BE=======--