jQuery-File-Upload blueimp PHP-MySQL-database-update data

回眸只為那壹抹淺笑 提交于 2019-12-12 00:43:42

问题


how to make changes to the data 'title' and 'description' after the image is loaded, for example, add a button to "change"?

This is all done up and running https://github.com/blueimp/jQuery-File-Upload/wiki/PHP-MySQL-database-integration

Here is my code, but here it is necessary to make a new method to "upgrade" and synchronize it with html:

html:

name <br /><input name="title[]" value="{%=file.title||''%}">
description<br /> <input name="description[]" value="{%=file.description||''%}">

php:

public function update($print_response = true) {
    $response = parent::update(false);
    foreach ($response as $name => $update) {
        if ($update) {
            $sql = 'update set  `title`=? ,`description`=? ' 
                .$this->options['db_table'].'` WHERE `name`=?';
            $query = $this->db->prepare($sql);
            $query->bind_param('sss',$file->title,$file->description, $name);
            $query->execute();
        }
    } 
    return $this->generate_response($response, $print_response);
}

JS?

来源:https://stackoverflow.com/questions/20090255/jquery-file-upload-blueimp-php-mysql-database-update-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!