[solved] Formatting output this way !! HOW ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

[solved] Formatting output this way !! HOW ???

Post by igoy »

This is a scenario .......

I have a MySQL table with two fields, which basically stores field_name & field_value.

it is basically a kind of history of previously used values in a perticular form. This table is used to re-use these values while filling out form.

The table structure is like this

Code: Select all

-----------------------------------------------
Table Name : fld_data
-----------------------------------------------

   field_name      |   field_value
--------------------|--------------------------
   name              |   Johny Bravo
   name              |   Freddy Dead
   name              |   Jack Ripper
   age                 |  15 yrs
   age                 |  35 yrs
   location           |  india
   location           |  england
   location           |  Mars
   age                 |  50
-----------------------------------------------
Now name, age and location are form fields. User has facility to store whatever data he is entering in form to this perticular table (fld_data), and insert any previously used valued from DB, so that there is no need to type same values everytime.

Now what I want to do is creating a page where user can edit / delete, values in this table.

I am stuck on how can I output the form that can edit this data, that is
I want to create a list of field_name.

something like this, say currently I have name, age, location in my table. so the list will be
name
age
location
not like this...
name
name
name
age
age
location
location
location
age

so the million dollar question is How?.
Can anyone please guide me how can I achieve this ?
Last edited by igoy on Mon Dec 22, 2003 8:47 am, edited 1 time in total.
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

[Solved]

Post by igoy »

I'm such a Bumhead....
such a basic thing and I wasted my precious 20 min writing this post.

How the Hell I forgot to use GROUP BY in SQL query....

:)

Well, it's solved.. and I'm ashmed as hell for being such a ignorant jerk.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

want me to call you names etc? free of charge! :twisted:
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

Post by igoy »

Lol... why you ***** ?

Thanks Quad, but I guess I'm already enough ashamed for posting this question.... so thanks for names.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

igoy wrote:Thanks Quad...
Haha, it's not only me then that puts a 'U' in your name the Qads :)

Mark
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

Bech100 wrote:
igoy wrote:Thanks Quad...
Haha, it's not only me then that puts a 'U' in your name the Qads :)

Mark
It's called calling names Mark. Now BeUch100!

-Nay
User avatar
igoy
Forum Contributor
Posts: 203
Joined: Fri May 02, 2003 11:57 pm
Location: India
Contact:

Post by igoy »

Lol, It might have something to do with Quake... you see I play lot of Quake and Love playing with "Quad Damage", quake guys will know what is "Quad Damage".

so QADS, sorry about "U".
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

so QADS, sorry about "U".
Yeah, I feel sorry for him too :lol:

-Nay
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

lol :lol:

i am gona msg jason and have "quads" listed as a bad word and have it replaced by "qads" :twisted:
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

or just replace "qads" with "quads" ? :lol:
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

sent the msg, lets see what happens :P
Post Reply