note 83245 added to function.odbc-exec
| From: | morten at nilsen dot com | Date: | Fri, 16 May 2008 12:50:01 +0000 |
| Subject: | note 83245 added to function.odbc-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139446@lists.php.net to get a copy of this message | ||
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);
?>
----
Server IP: 128.39.198.38
Probable Submitter: 213.167.124.250
----
Manual Page -- http://www.php.net/manual/en/function.odbc-exec.php
Edit -- https://master.php.net/note/edit/83245
Del: integrated -- https://master.php.net/note/delete/83245/integrated
Del: useless -- https://master.php.net/note/delete/83245/useless
Del: bad code -- https://master.php.net/note/delete/83245/bad+code
Del: spam -- https://master.php.net/note/delete/83245/spam
Del: non-english -- https://master.php.net/note/delete/83245/non-english
Del: in docs -- https://master.php.net/note/delete/83245/in+docs
Del: other reasons-- https://master.php.net/note/delete/83245
Reject -- https://master.php.net/note/reject/83245
Search -- https://master.php.net/manage/user-notes.php