Hallo,
ich versuche gerade aus einem Mehrdimensionalen Array ein INSERT INTO zu bauen.
Leider schlägt die fehl.
Ich glaube der ganze Ansatz ist Falsch.
Hat da jemand evtl. eine Lösung?
ich versuche gerade aus einem Mehrdimensionalen Array ein INSERT INTO zu bauen.
Leider schlägt die fehl.
Quellcode
- $scrip_settings = array(
- array('sid' => '1','name' => 'enablecalendar','title' => 'Enable Calendar Functionality','description' => 'If you wish to disable the calendar on your board, set this option to no.','optionscode' => 'yesno','value' => '1','disporder' => '1','gid' => '1','isdefault' => '1'),
- array('sid' => '2','name' => 'bbcodeinserter','title' => 'Clickable MyCode Editor','description' => 'Set this option to On to show the clickable code buttons editor on posting pages. Switching this off will also disable the Smilies Inserter.','optionscode' => 'onoff','value' => '1','disporder' => '1','gid' => '2','isdefault' => '1'));
- $columns = implode(", ",array_keys($scrip_settings));
- $escaped_values = array_map('mysql_real_escape_string', array_values($scrip_settings));
- $values = implode(", ", $escaped_values);
- $sql = "INSERT INTO scrip_settings ($columns) VALUES ($values) ;";
- db_query($sql);
Ich glaube der ganze Ansatz ist Falsch.
Hat da jemand evtl. eine Lösung?