MySQL Update语句不适用于图库

时间:2013-08-21 00:22:29

标签: php mysql sql image gallery

我有一个名为images_users的表,在这个表中我有


1 img_uploader,
2 img_name,
3 img_id,
4 img_type,
5 img_size,
6 img_upload_date,
7 img_description
8 img_new_name
9 img_modification

在上传阶段I中,将信息插入1/2/3/4/5/6
所以现在在修改页面中我完全无法改变我尝试过的任何价值,但一切都没有改变

$req = $BDD->prepare('UPDATE images_users SET 
                                                    img_name =:NEW_img_name, 
                                                    img_id   =:NEW_img_id,, 
                                                    img_new_name =:NEW_img_new_name,
                                                    img_description =:NEW_img_description,
                                                    img_modification = NOW()
                                                    WHERE img_uploader =:username

                                ');
            $req->execute(array(        
                                        'NEW_img_name'         =>   $nom_image_old, 
                                        'NEW_img_id'           =>   $shuffled,
                                        'NEW_img_new_name'     =>   $nom_image_new,
                                        'NEW_img_description'  =>   '',
                                        'username'             =>   $_SESSION['username'],

                                ));

问题在哪里:D ????

1 个答案:

答案 0 :(得分:0)

img_id =:NEW_img_id,,

的更新语句中有一个额外的逗号

尝试:

$req = $BDD->prepare('UPDATE images_users SET 
                                                img_name =:NEW_img_name, 
                                                img_id   =:NEW_img_id,  
                                                img_new_name =:NEW_img_new_name,
                                                img_description =:NEW_img_description,
                                                img_modification = NOW()
                                                WHERE img_uploader =:username

                            ');