Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "../../inc/config.inc.php";
- $temp = explode("_", $_REQUEST['element_id'] );
- $field = $temp[0];
- $id = $temp[1];
- $textboxval = stripslashes(mysql_real_escape_string(preg_replace('/[$]/',"",$_REQUEST["update_value"])));
- $query = "INSERT INTO notes ($field,status,date,c_id) VALUES ('$textboxval','1',NOW(),'$id')";
- mysql_query($query);
- echo($_REQUEST['update_value']);
- ?>
- UPDATE notes SET status = 0
- <?php
- include "../../inc/config.inc.php";
- $temp = explode("_", $_REQUEST['element_id'] );
- $field = $temp[0];
- $id = $temp[1];
- $textboxval = mysql_real_escape_stringstripslashes((preg_replace('/[$]/',"",$_REQUEST["update_value"])));
- // set older entries to 0 - to not show but show in history
- $hide_notes = "UPDATE notes SET status = 0";
- mysql_query($hide_notes);
- // add new entry with status of 1 to show only latest note
- $query = "INSERT INTO notes ($field,status,date,c_id) VALUES ('$textboxval','1',NOW(),'$id')";
- mysql_query($query);
- echo($_REQUEST['update_value']);
- ?>
- UPDATE notes SET status = 0 WHERE id != $newly_generated_id
- $insert = mysql_query("INSERT INTO ...");
- $last_id = mysql_query("SELECT LAST_INSERT_ID()");
- $update = mysql_quqery("UPDATE notes SET status = 0 WHERE id != $last_id");
Add Comment
Please, Sign In to add comment