0

我有一个名为 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

在上传阶段我将信息插入到 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 ????

4

1 回答 1

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

                            ');
于 2013-08-21T00:46:52.820 回答