Querying MySQL [Resolved]
I though I knew a bit about querying MySQl, but the PHP syntax is killing me here...:D
I want to get the results from a table called arrangement in a database that is called klub_info. I only want to get the fields that has an O in the aBy field. But I can't get the syntax to work at all. I have no clue here...I am stil reading in my stupid book here. But it's not a very good book.
this is what I more or less wrote straight from my book:
Code:
$sterm = 'O';
$stype = 'aBy';
$resultat = mysql_query("select * from arrangement where ".$stype." like '%".$sterm."%'",$db);
while($arr = mysql_fetch_array($resultat)){
echo '$resultat';
}
But I can't see where I am choosing the table I want. And I havn't even gotten to the point to use Select to strip down to the fields I actually want from my search result.
PS: aBy is an Enum field that can only hold 'O', 'B' or 'T'....
[Edit]Added two lines I forgot to the code[/edit]
Any ideas?