Make (in memory) database of musical instruments and database stores.
Base 1 must have:
instrument id
name of the instrument
instrument model
Base 2 must have:
shop id
stores name
stores address
*
input:
The user enters the name of the instrument in the variable at the beginning of the program.
output:
The program broadcasts a list of all the instruments of a similar name and the shops where it is located.
conditions:
Arrays and loops Must be used
This an assignment I’m having trouble with. When I asked how to make the connection between stores and instruments I was given this as an answer.
[php]
$instruments = array(
“1”=>“Guitar”,
“2”=>“Drums”
);
$stores = array(
“1”=>“Mitros”,
“2”=>“Mega”
);
$stores_instruments = array(
array(1,2),
array(1,1),
array(2,1)
);
[/php]
And this is my progress so far
[php]
[/php]
I’m not the last array is correctly done, plus I need help with the loop, I think the foreach should be used.
The html part isn’t important.
Any help would be appreciated.