https://www.icyphoenix.com/viewtopic.php?f=26&t=3693
-----------------------------------
losthillsguy
Mon 25 Feb, 2008 21:24

FAP SUPPORT - Bug When Trying To Edit A Photo Title After It's Posted.
-----------------------------------
I could not edit a photo after it was posted, here is what I got.
Any ideas to correct the problem?
Thanks


Could not update pic information

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 '1959 Cab During Restoration - 002', pic_desc= '' WHERE pic_i

UPDATE phpbb_album SET pic_title = 'My '1959 Cab During Restoration - 002', pic_desc= '' WHERE pic_id = '9'

Line : 188
File : album_edit.php


-----------------------------------
Mighty Gorgon
Tue 26 Feb, 2008 00:49

Re: Bug When Trying To Edit A Photo Title After It's Posted.
-----------------------------------
It is a wrong escaped SQL...

Can you try to edit that SQL in this way please?

[codeblock]	$sql = "UPDATE ". ALBUM_TABLE ."
			SET pic_title = '" . $pic_title . "', pic_desc= '" . $pic_desc . "'
			WHERE pic_id = '" . $pic_id . "'";[/codeblock]

If it doesn't work we need to add "ADDSLASHES" function...

Which version of FAP do you have?


-----------------------------------
losthillsguy
Tue 26 Feb, 2008 16:11

Re: Bug When Trying To Edit A Photo Title After It's Posted.
-----------------------------------
using  FAP 1.4.1, is this the latest version?

I made the edit,  sometimes it works and sometimes it doesn't.    Here is the debug message after the edit.

Could not update pic information

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 550 Spyder Bike with Fat Boy tires - 004', pic_desc= ''

UPDATE phpbb_album SET pic_title = 'Mark's 550 Spyder Bike with Fat Boy tires - 004', pic_desc= '' WHERE pic_id = '44'

Line : 188
File : album_edit.php


-----------------------------------
losthillsguy
Tue 26 Feb, 2008 16:52

Re: Bug When Trying To Edit A Photo Title After It's Posted.
-----------------------------------
Seems to be working.  I only got the debug message once.


-----------------------------------
Mighty Gorgon
Tue 04 Mar, 2008 02:14

Re: Bug When Trying To Edit A Photo Title After It's Posted.
-----------------------------------
It is related to single quote...

It is strange that on some server it still doesn't work.

Anyway let me know if you are still having problems.


