I have a big problem (for me, hopefully not for anybody else).
I have a databse where every data is strored in one table, and they are grouped by 'item'. every data that have the same item belongs toghether, and represent different kind of data accourding to the row header.
http://gimmikk.se/tempfiler/mysqlstruct_1.gif
(I have not build this structure - the firm before went bankrupted...)
Now I want to do a search, for instance search for a play that I now is called Cabaret [somethin] (header column 91) and that have 30 actors in it (header column = 294). I want to have a advanced search page where I could tell exactly what to search for.
http://gimmikk.se/tempfiler/mysqlstruct_2.gif
I have this code, but it does not work...
if(isset($_GET[tbActorsTotal])) {
$S1 = "AND item_facts.fact LIKE '$_GET[tbActorsTotal]' ";
} else {
$S1 = "";
}
if(isset($_GET[tbActorsFemale])) {
$S2 = "AND item_facts.fact LIKE '$_GET[tbActorsFemale]' ";
} else {
$S2 = "";
}
if(isset($_GET[tbActorsMale])) {
$S3 = "AND item_facts.fact LIKE '$_GET[tbActorsMale]' ";
} else {
$S3 = "";
}
$SokString = "$S1 $S2 $S3";
$sqlsokresultat = "SELECT item_category.item, item.name, item.number FROM item_category, item, item_facts WHERE item_category.category = 12200 AND item.number = item_category.item AND (item.name LIKE '%$_GET[tbTitle]%' AND item_facts.fact = '$_GET[tbActorsTotal]') LIMIT 0,30";
$sokresultatet = mysql_query($sqlsokresultat);
<?php
while(list($mera, $titel, $nummer) = mysql_fetch_row($sokresultatet))
{
?>
<p><?=$nummer?>"> - <?=$titel?></p>
<?php
}
?>
Does anyone understand what I want to do, and does anyone have a suggestion?