Jump to content

Backquote Delete Issue


benaust

Recommended Posts

Hi Guys

 

Working script that stopped working.

 

The delete section of a PHP - Mysql script stop working.

 

$deleteSQL = sprintf("DELETE FROM `TBL_PImg` WHERE PImg_Ref=%s",

                      GetSQLValueString($_POST['PImgRef'], "text"));

 

The table name had the Backquote at start, then it stopped working and removed it and it worked and now it does not work in both situations.

 

I know it is something that is changed in host, but I cannot make them understand and asking what they have changed or upgraded has no answer.

 

Have someone had any similar issue that could help please/

 

Thanks

 

Ben

 

Link to comment
https://forums.phpfreaks.com/topic/225487-backquote-delete-issue/
Share on other sites

Well sorry maybe bad explanation,

 

The script deletes the last image in its group. e.g

 

IMG_A_001, IMG_A_002, IMG_A_003, IMG_A_004

IMG_B_001, IMG_B_002, IMG_B_003, IMG_B_004

 

If I try to delete the "IMG_A_002" the scripts deletes the last one "IMG_A_004" not the right one. Not the last row from the table the last one in group A let’s say.

 

Do not understand it.

 

It's more likely that your code that is generating the form is putting the wrong value in the 'PImgRef' field and $_POST['PImgRef'] doesn't contain what you expect. This has nothing to do with the back-ticks and your table name.

 

Have you done a 'view source' in your bowser of your form page so that you know it is correct?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.