I am trying to solve a problem from last two hours. I cannot see any error in the code and everything is working fine till I check the database. Even the echo is working fine and I can see all the variables echoing in the page. But when I check the database the rows do not get updated. Below is the code:-
mikosiko wrote:$sql=
"UPDATE test
SET Bank='$bank', PAID='$paid', BID='$bid', amr=$amr, bmr=$bmr // Missing '
WHERE PRN='$techprn'
Oh Sorry that was a small mistake which I had corrected. Actually I had added the amr and bmr variables just to check whether the database gets updated when we declare the variables in the same page. This is eating away my age. When I post the variables with the same name from another page in my local system it gets updated to the database. But when I use the actual third party application it echoes the value but does not get updated in the database. This is a very amazing kind of problem I have ever seen.
Is there anyone who can help me out. The code is working fine when I am posting the variables from a local system.
Ok lemme elaborate it. I am trying to integrate a payment application in which the Bank sends us the 3 variables which we append to the record added in the table in the first stage when the user entered his personal information. These 3 variables need to be updated in the 3 columns but it is not happening when the realtime transaction is done. I am astonished that the echo happens and it seems that everything is ok. But when I check the database the 3 columns are still empty. Is there anyone who has faced the similar situation while configuring a payment application? Please help me out in this.
if the code that you posted is working when you test it passing the variables locally and only fail when you try to integrate it with your 3rd party application is in reality not easy to guess what is going on without knowing how that 3rd party app is sending you the variables/values and how are you capturing it.
I did not try using $_GET. But I will definitely try it tommorrow from office as I do not have the CP access here to check the database. But I do not understand if the variables are getting printed (echo) in the screen why does not it get updated to the database. My only intention to use the echo was to check that whether the variables are coming to my website in a proper way. Thanks a lot for this suggestion. Any other suggestions to solve this issue are welcome. I will definitely post the solution and the reason it is happening once I find the solution. Keep watching for more posts.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
I was able to solve the problem and I still do not know why this happened. I deleted all the records in the table and it started working fine. However the flaw is there once in 10 times in average. I am still trying to find out the reason of this inefficiency. I am sure it is due to the slowness of the connection because I am retrieving the variables from a secure payment gateway which takes some time to load. Otherwise no other factor can are having conditions that may vary in different trials. Anyways thanks a lot for the help. Anybody has suggestions why this kind of problems may occur?