Jump to content


Photo

**solved** MySQL/php display results help


  • Please log in to reply
2 replies to this topic

#1 chronmar

chronmar
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 09 April 2006 - 06:57 PM

I am accessing a database with about 100 columns... is there a way to display the column name from the query as well as the data entered without hard coding each column name? so far all the querys I have done I specify the column name (i.e. $row['email'] or $row['question_1']) I was not sure if I could do an array with the column name as key and the data as value and print each out in a table. Please help if you can...



i.e.

email I question_1 I question_2
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
i@i.com I yes I no




#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,016 posts

Posted 09 April 2006 - 07:02 PM

See this reply

[a href=\"http://www.phpfreaks.com/forums/index.php?act=ST&f=12&t=90262&hl=&view=findpost&p=362398\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...ndpost&p=362398[/a]
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 chronmar

chronmar
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 09 April 2006 - 07:08 PM

thank you very much!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users