View Single Post
Old 11-26-2012, 09:46 PM   PM User | #8
stevenryals
New Coder

 
Join Date: Jul 2012
Posts: 60
Thanks: 4
Thanked 0 Times in 0 Posts
stevenryals is an unknown quantity at this point
OK.. i think im on a good path here..

I'm doing this after connecting and printing the table headers:

Code:
$result = mysql_query("SELECT * FROM {$table}");
if (!$result) {
    die("Query to show fields from table failed");
}


while($rows=mysql_fetch_array($result))  {
?>
<tr>
<?php 
$sQry = 'SELECT `tag`, `price`, MIN(`price`) AS lowest FROM expedia GROUP BY `tag`';
if (!$sQry) {
     printf('<td align='center' border='1' frame="box" rules="all"><? echo $rows['tag']; ?></td>');  
}
else 
{
        printf('<tr><td title="%s">%s</td><td>%0.2f</td></tr>', 'Lowest Price: ' . $row['lowest'], $row['identifier'], $row['price']);
}
mysql_free_result($sQry);
?> 
<td align='center' border='1' frame="box" rules="all"><? echo $rows['url']; ?></td>
<td align='center' border='1' frame="box" rules="all"><? echo $rows['price']; ?></td>

</tr>

<?php
}
?>
</table>
Not working as of yet..

i'm able to get it done with a while within the if.. but i cant get back to the original SQL data..
(if you can't tell i've only been learning SQL for about 2 months.. sorry so noob)

Last edited by stevenryals; 11-26-2012 at 09:50 PM..
stevenryals is offline   Reply With Quote