PHP/Mysql question
Posted: Mon Sep 06, 2010 2:47 am
Hi. I wrote a simple script to grab information out of a database for ips on my home network. Right now my page just grabs every row, every column from the db and prints it in a html table.. very simple. Now I want to make it alittle more complicated but easier for the user. Every ip has a user assigned to it.. instead of listing one large table, I want the php script to make a new table for each user. How would I even start something like this? My columns are:
id ip hostname device_name mac rule user
sample data:
2.2.2.2 testadfadfs testadsf test arp -i br0 -s 2.2.2.2 00:16:3E:7A:14:38 matt
So you see I have multiple rows with user as "matt". I am thinking I could just make several sql queries/and loops in my php file for each user, but I am going to be adding more users/device sections as I go and I would like this to be automatic.
id ip hostname device_name mac rule user
sample data:
2.2.2.2 testadfadfs testadsf test arp -i br0 -s 2.2.2.2 00:16:3E:7A:14:38 matt
So you see I have multiple rows with user as "matt". I am thinking I could just make several sql queries/and loops in my php file for each user, but I am going to be adding more users/device sections as I go and I would like this to be automatic.