note 83245 deleted from function.odbc-exec by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 11:00:00 +0000 |
| Subject: | note 83245 deleted from function.odbc-exec by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196997@lists.php.net to get a copy of this message | ||
Note Submitter: morten at nilsen dot com
----
Regarding the query-building for collecting large forms, this would be better:
<?php
foreach($_POST as &$v)
$v = str_replace("'", '', $v);
$sql = 'INSERT INTO table (' . join(',',array_keys($_POST)) . ') VALUES
(' . join(',', array_fill(0, count($_POST), '?')) . ')';
$query = odbc_prepare($conn, $sql);
$result = odbc_execute($query, $_POST);
?>