$GetBusinessType = mysql_query("SELECT * FROM businesstype
WHERE Businesstypes='$Business'")
or die(mysql_error());
// Fetch the row from the database
if (!($row = mysql_fetch_assoc($GetBusinessType))) {
echo "Business not found!";
echo mysql_error();
}
And it works dandy but I want to change it so that it does something like this.. say theres 3 rows in the database:
Type - ID
Shop - 20
Shop - 13
Shop - 14
What i want my query to do is find the business type which is does.. and get all the rows and then select only the lowest ID out of the 3.
So it would load up Shop - 13 in other words... is this possible?
Last edited by SirChick on Tue Oct 23, 2007 1:21 pm, edited 1 time in total.
Would it really need group by? As its only going to find the one type of shop anyway [s]cos[/s] because of this Businesstypes='$Business'
say $Business was = Shop... then group by won't be needed.. surely?
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.