Database help

I have your basic database code here so I can pull the data to a web page. What I am asking/needing is My database has 31 columns. I am assuming ill have to type out all 31 diff column names, via a echo command like so " echo "

bid_id Bid_category to get it to display
" there is no way to just tell it in code to say read the first column name through the last column name ? Code as follows not 100% done but I hope I am going in the right direction. Any help with this code would be great

[php]

display data from DB table { Border:2px solid red; background-color: #ffc; } th { border-bottom: 5px solid #000; } th { border bottom 2px solid #666; }

display data from DB

<?php mysql_connect(' http://www.biducation.com/phpMyAdmin/', 'biducation', 'xx-biducation-db')or die(mysql_error()); echo "connected to MySQL

"; mysql_select_db("biducation")or die(mysql_error()); echo "connected to database

"; $query = "SELECT * FROM tbl_bids"; $result = mysql_query($query) or die(mysql_error()); echo "

"; echo " } ?> [/php]
bid_id Bid_category

Look up the mysql_num_fields command this will do what you want to read the field names from your database.

Sponsor our Newsletter | Privacy Policy | Terms of Service