Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 82
Trades: 0
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 02:09 PM.. Reason: change of question
SpottyDog is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-18-2005, 01:43 PM
SpottyDog's Avatar
Skilled Talker

Posts: 82
Trades: 0
?

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

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

Posts: 297
Trades: 0
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:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 05-18-2005, 09:14 PM
Novice Talker

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.14679 seconds with 12 queries