mysql数据库插入将所有ID更改为4294967295 [英] mysql database insert is changing all IDs to 4294967295

查看:162
本文介绍了mysql数据库插入将所有ID更改为4294967295的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

真的很奇怪,我的数据库。我使用PHP插入数据到我的数据库,我一直在做这个过去2年没有任何问题。当客户在我的网站上付款时,我将来自该交易的所有数据存储在我的数据库中。每个事务都有一个唯一的transaction_id。当我将付款信息插入数据库时​​,除了transaction_id之外,所有信息都正确插入。所有事务都被赋予transaction_id4294967295。所以我做了一些测试。这是我做的:

Something really weird is going on with my database. I am using PHP to insert data into my database and I have been doing this for the past 2 years without any problems. When a customer makes a payment on my website, I store all of the data from that transaction in my database. Each transaction has a unique "transaction_id". When I insert the payment information into the database, all of the information is correctly inserted except for the "transaction_id". ALL transactions are given the "transaction_id" of "4294967295". So I did some testing. Here is what I did:

1)我回显了transaction_id到我的屏幕,看看会说什么。结果是,被回显的transaction_id是CORRECT。这不是重复的4294967295。但是,当我在我的数据库中,它显示4294967295。

1) I echoed out the "transaction_id" to my screen to see what is would say. The results were that the "transaction_id" that was being echoed out was CORRECT. It was not the repeating "4294967295". However, when I look in my database, it shows "4294967295".

2)这次我决定将查询回传给我的网络浏览器。查询为CORRECT。在查询中,CORRECTtransaction_id在查询中。但是,当我查看我的数据库,它显示4294967295。

2) This time I decided to echo out the query to my web browser. The query was CORRECT. In the query, the CORRECT "transaction_id" was in the query. However, when I look in my database, it shows "4294967295".

我有3个不同的网页,客户可以付款。所有3页在2012年4月6日开始这样做。这些页面都没有被修改。我没有在2年内修改这些页面。非常感谢任何帮助。

I have 3 different pages where customers can make payments. ALL 3 pages started doing this on April 6th, 2012. None of those pages were modified at all. I have not modified those pages in over 2 years. Any help is greatly appreciated!

$query = "INSERT INTO payments (customer_id, transaction_id, invoice_number, authorization_code, subscription, subscription_id, avs_result, cvv_result, amount, full_tuition, payment_date, ip_address) VALUES ({$_SESSION['customer_id']}, {$_SESSION['transaction_id']}, {$_SESSION['invoice_number']}, '{$_SESSION['authorization_code']}', '{$_SESSION['subscription']}', {$_SESSION['subscription_id']}, '{$_SESSION['avs_result']}', '{$_SESSION['cvv_result']}', {$_SESSION['amount']}, {$_SESSION['full_tuition']}, '{$_SESSION['payment_date']}', '{$_SESSION['ip_address']}')" ;
$result = mysqli_query($dbc, $query) OR die ('<p>There was an error with the INSERT payments query.: ' . mysqli_error($dbc) . '<br />Query:' . $query . '</p>') ;

echo '<p>Transaction ' .  $_SESSION['transaction_id'] . ' has been <font color="green">APPROVED</font> by the system.</p>' ;

echo '<br /><br />' ;

echo '<p>Below is a summary:</p>' ;
echo '<p>Transaction ID: ' .  $_SESSION['transaction_id'] . '<br />
Payment Method: XXXX<br />
Amount: $' . $amount . '<br />
Customer Name: ' . $_SESSION['first_name'] . ' ' . $_SESSION['last_name'] . '<br />
</p>' ;

echo "<p>Note: Please do NOT click the browser's Back button to enter a new transaction.</p>" ;


echo $query ;


推荐答案

您的数字大于DB中的字段句柄...

Your number is larger than the field in the DB can handle...

4294967295是更大的数字32位可以容纳,您的事务ID现在大于您的数据库可以容纳的数字字段。

4294967295 is the largers number 32 bits can hold, your transaction ID is now larger than the numerical field your DB can hold.

这篇关于mysql数据库插入将所有ID更改为4294967295的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆