Reply
Variable In SQL Query
Old 05-18-2005, 12:25 PM SQL Query
SpottyDog's Avatar
Skilled Talker

Posts: 82
Hey up again!

How can i make a dropdown box / list containing the names of all fields in a table and the values of each name to be the same?

Thanks

Last edited by SpottyDog : 05-18-2005 at 01:09 PM. Reason: change of question
SpottyDog is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-18-2005, 12:43 PM
SpottyDog's Avatar
Skilled Talker

Posts: 82
?

Last edited by SpottyDog : 05-18-2005 at 01:08 PM.
SpottyDog is offline
Reply With Quote
View Public Profile
 
Old 05-18-2005, 05:40 PM
SpottyDog's Avatar
Skilled Talker

Posts: 82
anyone?
SpottyDog is offline
Reply With Quote
View Public Profile
 
Old 05-18-2005, 06:20 PM
leavethisplace's Avatar
Ultra Talker

Posts: 297
dude (and anyone else without the patience of a priest) you gotta wait for a reply, we don't just sit here waiting for the next person that needs help! Where on this page does it say instant reply, instant chat or instant messenger?

As for how to get the names of all the fields, do this

PHP Code:
$result msql_query("SELECT * FROM table WHERE id=1"$link);
if (!
$result) {
   die(
"query failed: " msql_error());
}

$x 1// Result set starts from 1

echo "Field names:<BR>";

while (
$x msql_num_fields($result)) {

  echo 
msql_field_name($result$x);
  echo 
"<BR>";

  
$x++;


In theory this should work, but im not totally sure! Cause i've not tested it, i just used the PHP Manual.
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites: www.festerband.com | www.thegourmetpatisserie.co.uk
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 05-18-2005, 08:14 PM
Novice Talker

Posts: 7
Thanks!
dave123 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Variable In SQL Query
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14065 seconds with 12 queries