What I am wanting to do is create an array that will read the field from 'auction_offer_title' and store it so it can be echo'd. Here is what I have so far:
Code: Select all
//set array variable
$results = array();
//talk to the db
$query = "SELECT * FROM `phpbb_auction_offer`";
$result = mysql_query($query) or die(mysql_error());
//count the rows and fields
$totalRows = mysql_num_rows($result);
$totalFields = mysql_num_fields($result);
//start the loop
for ( $i = 0; $i < $totalRows; ++$i ) {
//make it 2 dim in case you change your order
$results[$i] = mysql_fetch_array($result);Current auctions: dog, cat, mouse
If there are only "dog" and "cat" in the database, then obviously only display those 2. I've got it figured out where it'll read the first row and display it using this code:
Code: Select all
//
//Count the number of auctions
//
//select the table
$query="SELECT * FROM `phpbb_auction_offer`";
$result=mysql_query($query);
//cound the number of rows to be used later maybe
$num=mysql_numrows($result);
/gets the title of the first auction
$auction_title=mysql_result($result,$i,"auction_offer_title");
//End auction countCode: Select all
'TOTAL_AUCTIONS' => $auction_title,