问题
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