benaust Posted January 24, 2011 Share Posted January 24, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/225487-backquote-delete-issue/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 24, 2011 Share Posted January 24, 2011 How do you know it is not working? Does the query produce an error, as indicated by using mysql_error(); or does it simply fail to match any rows in your table? Quote Link to comment https://forums.phpfreaks.com/topic/225487-backquote-delete-issue/#findComment-1164345 Share on other sites More sharing options...
benaust Posted January 24, 2011 Author Share Posted January 24, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/225487-backquote-delete-issue/#findComment-1164358 Share on other sites More sharing options...
PFMaBiSmAd Posted January 24, 2011 Share Posted January 24, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/225487-backquote-delete-issue/#findComment-1164363 Share on other sites More sharing options...
benaust Posted January 24, 2011 Author Share Posted January 24, 2011 I do not know how to thank you. You are right on spot and what I cannot workout is what possessed me not to test this "echo echo echo Ben" Thanks mate appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/225487-backquote-delete-issue/#findComment-1164368 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.