VRK Posted May 7, 2009 Share Posted May 7, 2009 Hi All, I am new to PHP programming. Am developing a website for a client. In one page am getting the values through GET method. When i tried to echo that value, it's printing fine. But when i try to store in DB, it's storing the previous value ie when i tried for the first time. Please help me on this.... It's Urgent. Quote Link to comment https://forums.phpfreaks.com/topic/157207-solved-php-code-help/ Share on other sites More sharing options...
trq Posted May 7, 2009 Share Posted May 7, 2009 We need to see relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828364 Share on other sites More sharing options...
VRK Posted May 7, 2009 Author Share Posted May 7, 2009 Thx for ur reply first. Ill exp u the problem, Consider a link www.mysite.com?tran_id=123 When i tried to get the value from the url through $_GET['tran_id'] and printing it, it's printing fine. Also am inserting this id in my query "insert into test(id) values ($id)". It's storing the id value as 123 in DB all the time even id value varies. Am getting the ID values from API(Authorize.net). Quote Link to comment https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828369 Share on other sites More sharing options...
Adam Posted May 7, 2009 Share Posted May 7, 2009 Again need to see the code. No reason why it would do that ordinarily. Quote Link to comment https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828371 Share on other sites More sharing options...
VRK Posted May 7, 2009 Author Share Posted May 7, 2009 link: http://www.mysite.com/trans_id=123 <? if(isset($_GET['response'])) { $transid = $_GET[trans_id]; $sql = "insert into trans_info(transaction_id) values(' '$transid')"; mysql_query($sql); } else{ echo "<p style='font-size:14px;margin:0;line-height:18px;color:red'>"; echo "Unauthorized Access!!!"; echo "</p>"; } In DB: Storing as , 123 If am gettting the id value as 76786 then too storing as, 123 Quote Link to comment https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828373 Share on other sites More sharing options...
VRK Posted May 7, 2009 Author Share Posted May 7, 2009 I found the solution Thx for ur quick response. Quote Link to comment https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828409 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.