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.
FAP SUPPORT - "Could Not Insert New Entry"
Subject: 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.
I reply with any updates.
Subject: 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:
SOURCE:
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:
Subject: 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.
Others should apply the fix, but if you are not having an error with apostrophe in title/description etc it is not absolutely necessary.
Page 1 of 1
You cannot post new topicsYou 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
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.2279s (PHP: 11% SQL: 89%)
SQL queries: 10 - Debug Off - GZIP Enabled