Icy Phoenix

     
 


This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 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.
 



 
davidcrandall99Send private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post 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.
 



 
davidcrandall99Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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:

Code: [Download] [Hide]
  1.       
  2. open album_upload.php  
  3.  
  4. FIND  
  5. $pic_title = str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title'])));  
  6.  
  7. $pic_desc = str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, album_config['desc_length'])));  
  8.  
  9. $pic_username = (!$userdata['session_logged_in']) ? substr(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_username']))), 0, 32) : str_replace("'", "''", $userdata['username']);  
  10.  
  11.  
  12. REPLACE WITH:  
  13.  
  14. $pic_title = addslashes(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title']))));  
  15.  
  16.     $pic_desc = addslashes(str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, $album_config['desc_length']))));  
  17.  
  18.     $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.

Code: [Download] [Hide]
  1.     $pic_title = addslashes(str_replace("'", "''", htmlspecialchars(trim($_POST['pic_title']))));  
  2.  
  3.     $pic_desc = addslashes(str_replace("'", "''", htmlspecialchars(substr(trim($_POST['pic_desc']), 0, $album_config['desc_length']))));  
  4.  
  5.     $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.



 



 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 



 
ArtieSend private message  
Back to topPage bottom
This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies.  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
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