Hallo
Hoffentlich ist das das richtige Forum für meine Frage .
Also folgendes ist vorhanden:
Daraus muss ich jetzt für die weiterverarbeitung ein Array mit folgender Struktur erzeugen
$array["region"] = region_id
bzw.
$array["region"]["ort"] = ort_id
Das Problem ist, dass nicht alle regionen einen unterort haben. Wie lese ich denn das am besten aus? Braucht jetzt nicht den ganzen Code hinzuschreiben. Sagt mir einfach so stichwort artig wann was wohin auslesen. Bin jetzt schon stunden am rumprobieren. funktionieren tuts leider immernoch nicht.
Vielleich kann mir ja jemand helfen. Danke schon mal.
Gruss M
Edit:
Beispiel array. PHPtags funktionieren irgendwie nicht sorry
Hoffentlich ist das das richtige Forum für meine Frage .
Also folgendes ist vorhanden:
Code:
mysql tabelle "country" spalte c_id spalte country mysql tabelle "region" spalte region_id spalte c_id spalte region mysql tabelle "ort" spalte ort_id spalte c_id spalte region_id spalte ort
Daraus muss ich jetzt für die weiterverarbeitung ein Array mit folgender Struktur erzeugen
$array["region"] = region_id
bzw.
$array["region"]["ort"] = ort_id
Das Problem ist, dass nicht alle regionen einen unterort haben. Wie lese ich denn das am besten aus? Braucht jetzt nicht den ganzen Code hinzuschreiben. Sagt mir einfach so stichwort artig wann was wohin auslesen. Bin jetzt schon stunden am rumprobieren. funktionieren tuts leider immernoch nicht.
Vielleich kann mir ja jemand helfen. Danke schon mal.
Gruss M
Edit:
PHP-Code:
$temp = array();
$temp['Vancouver']['ort1'] = 'region_id=1&ort_id=1';
$temp['Vancouver']['ort2'] = 'region_id=1&ort_id=2';
$temp['Vancouver']['ort3'] = 'region_id=1&ort_id=3';
$temp['Vancouver']['ort4'] = 'region_id=1&ort_id=4';
$temp['Victoria']['ort blbla 1'] = 'region_id=2&ort_id=5';
$temp['Victoria']['ort blbla 2'] = 'region_id=2&ort_id=6';
$temp['Victoria']['ort blbla 3'] = 'region_id=2&ort_id=7';
$temp['Sonstwo']['anderer ort 1'] = 'region_id=3&ort_id=8';
Kommentar