Hi,Today I face a very weird problem which is I've a button which generate pid from database:

<a href="orderdetail.php?pid='.$OrderID.'"><button type="button">View Shipping Status!</button></a>

Let say my OrderID is 53588130964806920 and it will look like orderdetail.php?pid=53588130964806920 isn't ?

But after I click the button , the URL display well but when I echo the pid it show 2147483647. In between there is no any encryption or what to change the length. How can 53588130964806920 become 2147483647?? How can I let it display 53588130964806920 instead of 2147483647 ? Is that any length limit in URL variable?

Recommended Answers

All 2 Replies

2147483647 is the largest possible integer.
cast $OrderID as a string (typecasting)

Member Avatar for diafol

What you've generated that many orders??? Are you Bill Gates by any chance?

Seriously though, you need to start your order numbering at a lower point, e.g. 1,000,000 - you keep your sanity and the ability to use an autoincrement PK. In addition it still looks as though you've made a million+ transactions, if that's what you want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.