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
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.

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.