0

i just made a website on a local webserver(xampp)
now i'm uploading it to my webspace @ my hosting and i get the following error:
Error : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

what am i doing wrong?
this is the code:

<?php 
				$query = "SELECT COUNT(*) AS num, land FROM wijnen WHERE land = 'Argentinië' AND wijnen.kleur = 'Rood' GROUP BY land";
				$result = mysql_query($query) or die('Error : ' . mysql_error());
				while(list($num, $land) = mysql_fetch_array($result, MYSQL_NUM))
					{
						if ($land == ""){}
						else{
				?>
				<li class="sub">
					<a href="rood.php?id=Argentinië&sid=0&van=0&tot=10">Argentinië (<?php echo $num;?>)</a>
				</li>			
				<?php
							}
					}
				?>

i hope someone can help me out here :)

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Wraithmanilian
0

This is JUST a guess, but I think that the MySQL error is telling you that you can't do two things at once here. You're asking the command to get the COUNT(*) total of ALL records (hence the asterisk) and then wanting the values of 'land', which apparently HAs to be the value of "Argentinië", and saying that wijnen.kleur MUST equal 'Rood' even though you did not request it in the SELECT...

There's a lot wrong here. Because I only read English, the example makes it difficult to completely understand exactly what it is that you are trying to accomplish.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.