|
Page 1 of 1
|
davidcrandall99 
Joined: January 2007
Posts: 4
|
 FAP SUPPORT - "Could Not Insert New Entry"
Whenever I try to upload a picture, I always seem to get this:
Could not insert new entry
"DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's DAVID!', '2', '45e10284', 'David', '1169754455', '1', '1')' a
INSERT INTO phpbb_album (pic_filename, pic_thumbnail, pic_title, pic_desc, pic_user_id, pic_user_ip, pic_username, pic_time, pic_cat_id, pic_approval) VALUES ('943e2f670438d699ac704c819ab073c0.jpg', '943e2f670438d699ac704c819ab073c0.jpg', 'A Photo Of Me.', 'It's DAVID!', '2', '45e10284', 'David', '1169754455', '1', '1')
Line : 1204
File : album_upload.php"
Any suggestions on what to do? I'm using PHPBB 2.0.22
Any help is greatly appriciated!
David.
|
#1 Thu 25 Jan, 2007 20:50 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
davidcrandall99 
Joined: January 2007
Posts: 4
|
 Re: "Could Not Insert New Entry"
Ok. Now, I'm not completely sure if this will TOTALLY solve my problem, but I deleted the .htaccess files in album_mod/upload and all of it's subfolders. I went back to my album, and tried to upload the picture and it worked fine. However, I had this problem yesterday, and I just reset all my settings under Config in the Admin panel, and things started working, but today it messed up again. I'm seeing if this works. We'll see.
I reply with any updates.
|
#2 Thu 25 Jan, 2007 21:19 |
|
lefty74 
Joined: January 2007
Posts: 137
|
 Re: "Could Not Insert New Entry"
Hi, I think this problem is rather related to using apostrophe's in the title and not htaccess.
The fix for this is below:
-
- open album_upload.php
-
- FIND
- $pic_title = str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title'])));
-
- $pic_desc = str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, album_config['desc_length'])));
-
- $pic_username = (!$userdata['session_logged_in']) ? substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32) : str_replace("'", "''", $userdata['username']);
-
-
- REPLACE WITH:
-
- $pic_title = addslashes(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title']))));
-
- $pic_desc = addslashes(str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, $album_config['desc_length']))));
-
- $pic_username = (!$userdata['session_logged_in']) ? addslashes(substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32)) addslashes(str_replace("'", "''", $userdata['username']));
SOURCE:
Quote: -----------------------------------
Mighty Gorgon
Sun 24 Dec, 2006 00:25
Re: Fix For Problem With Apostrophe's In Description
-----------------------------------
You should not change that replacement, because is needed to correctly parse text in POST fields.
Use ADDSLASHES in front of it instead.
- $pic_title = addslashes(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title']))));
-
- $pic_desc = addslashes(str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, $album_config['desc_length']))));
-
- $pic_username = (!$userdata['session_logged_in']) ? addslashes(substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32)) addslashes(str_replace("'", "''", $userdata['username']));
This should do the trick.
Let me know.
|
#3 Thu 25 Jan, 2007 22:23 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: "Could Not Insert New Entry"
lefty74 is correct, applying the fix above should fix the problem for you.
Others should apply the fix, but if you are not having an error with apostrophe in title/description etc it is not absolutely necessary.
|
#4 Fri 26 Jan, 2007 18:22 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|