Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Here the user sets which table fields will be used:
- <input type="checkbox" name="id" value="1"> ID
- <input type="checkbox" name="name" value="1"> name
- <input type="checkbox" name="email" value="1"> email
- //Here I see what fields the user wants to use and set a variable to 1
- <?php
- if (isset($_POST['id']) && $_POST['id'] == "1") {
- $form_id='1';
- }
- //etc etc
- $sql = mysql_query("select * from mytable");
- $sql = mysql_query("select id, name from $table");
- $fields = [];
- if(isset($_POST['id']) && $_POST['id'] == 1) {
- $fields[] = 'id';
- }
- $fields = implode(', ', $fields);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement