Code: Select all
SELECT * FROM `fruits_colors` WHERE `name` = "default"
SELECT * FROM `fruits_colors` WHERE `name` = "example"
Code: Select all
//result from first query
$default_row = array(
'banana' => 'yellow',
'apple' => 'red',
'grape' => 'green',
'blueberry' => 'blue'
'raspberry' => 'red'
);
//result from second query
$example_row = array(
'banana' => 'yellow',
'apple' => 'GREEN',
'grape' => '',
'blueberry' => 'blue'
'raspberry' => ''
);
Code: Select all
$example_row = array(
'banana' => 'yellow',
'apple' => 'GREEN', // keep original from this array
'grape' => 'green', // filled from $default_row
'blueberry' => 'blue'
'raspberry' => 'red'// filled from $default_row
);
- Kann ich diese Arrays mit einer integrierten PHP-Funktion verbinden?
Vielleicht kann ich das direkt in einer SQL-Abfrage machen?