/ Published in: PHP
This generates a simple insert statement for mysql based on all the variables in $GET or $POST using a simple page. It does not do the inserts although that is a simple addition - just builds and displays your insert statement.
Expand |
Embed | Plain Text
<?php $fields = ''; $values = ''; $sql = display_post_get(); function display_post_get() { if ($_POST) { $fields .= $result_nme . "," ; $values .= $result_val . "','" ; } $strSQL = "Insert into YOURDB ($fields) VALUES ('$values)"; return $strSQL; } if ($_GET) { $fields .= $result_nme . "," ; $values .= $result_val . "','" ; } $strSQL = "Insert into YOURDB ($fields) VALUES ('$values)"; return $strSQL; } } ?>
You need to login to post a comment.
