Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/157207-solved-php-code-help/
Share on other sites

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828369
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/157207-solved-php-code-help/#findComment-828373
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.