Inline edit mysql rows


/ Published in: JavaScript
Save to your folder(s)

Add file updaterow.php and include js-code to your page.

updaterow.php
db_host, $CFG->db_name, $CFG->db_user, $CFG->db_pass);
$Dtb->connect();
$Session = new Session();
$Base = new Base();
$Auth = new Auth();

error_reporting(1);

$fieldname = $Base->convert_post_get("fieldname");
if(!$fieldname) exit();
$content = $_GET['content'];
list($field, $ind) = explode('-', $fieldname);

$sql = "update `b_aboard_msgs` set `$field` = '$content' where `id` = $ind";
$Dtb->query($sql);

echo $content;

?>

URL: http://www.bistro-site.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.