Crew-Portal Posted August 30, 2007 Share Posted August 30, 2007 Okay I need to insert a record into a database the only porblem is the record's number is infinity! How do I enter this number into mysql? is there a way for PHP to recognize infinity as a number? or how do I do this? Quote Link to comment Share on other sites More sharing options...
matthewhaworth Posted August 30, 2007 Share Posted August 30, 2007 Why would you want to do that? Also, infinity is not a number, it is a term, therefore it does not exist and cannot be written in MySQL. Quote Link to comment Share on other sites More sharing options...
madspof Posted August 30, 2007 Share Posted August 30, 2007 What do you meen by infity i.e do you meen unlimtited or a specific number. Computer cannot handle the number infity you would have to write something down to replace it for example null or infity. But if you need to insert a realy long number just enter it, i don see why the computer would not accept unless there was some kind of validation limiting the amount of numbers entered Quote Link to comment Share on other sites More sharing options...
trq Posted August 30, 2007 Share Posted August 30, 2007 Your question makes little sense. Infinity is NOT a number. Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted August 30, 2007 Author Share Posted August 30, 2007 members can rent items for a certain amout of time... This time is stored in a database. But they can also BUY the item. Which costs more money then renting but they get to use it for an infinate time frame. But I do not know how to enter the term infinity into a database so that the php scripts says "Hey that item is bought not being rented!" You know? Quote Link to comment Share on other sites More sharing options...
matthewhaworth Posted August 30, 2007 Share Posted August 30, 2007 members can rent items for a certain amout of time... This time is stored in a database. But they can also BUY the item. Which costs more money then renting but they get to use it for an infinate time frame. But I do not know how to enter the term infinity into a database so that the php scripts says "Hey that item is bought not being rented!" You know? Put 0. Because you can't rent something for 0 amount of time. That's most people's solution . Quote Link to comment Share on other sites More sharing options...
trq Posted August 30, 2007 Share Posted August 30, 2007 You could simply make all items that are owned have a time frame of 0. Quote Link to comment Share on other sites More sharing options...
madspof Posted August 30, 2007 Share Posted August 30, 2007 yes you could enter 0 and write a bit of extra cod e that checks hat value if it is 0 then it would display this item has been bought Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted August 30, 2007 Author Share Posted August 30, 2007 But I have items that are not bought or rented as a time frame of 0 Quote Link to comment Share on other sites More sharing options...
trq Posted August 30, 2007 Share Posted August 30, 2007 Then maybe you'll want to add another field. status, then set it to 0 for available, 1 for rented or 2 for bought. Quote Link to comment Share on other sites More sharing options...
madspof Posted August 30, 2007 Share Posted August 30, 2007 then set a item at a realy high number that would never be entered for a rented item and use that Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 30, 2007 Share Posted August 30, 2007 Its a very simple scenario. Just add another column "bought" and when an item is bought flag it as true, otherwise let the default false. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted August 30, 2007 Share Posted August 30, 2007 i agree with thorpe's status, or GuiltyGear bought, one in the same Quote Link to comment Share on other sites More sharing options...
madspof Posted August 30, 2007 Share Posted August 30, 2007 same here Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted August 30, 2007 Author Share Posted August 30, 2007 Okay Ill Try that! Thank you guys for helping me out! TOPIC SOLVED!! Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted December 7, 2007 Share Posted December 7, 2007 BTW, you could also use a negative number. Since you can't rent something for a negative amount of time :-/ Quote Link to comment Share on other sites More sharing options...
revraz Posted December 7, 2007 Share Posted December 7, 2007 Sounds like you are making a Airplane rental/sale page Quote Link to comment 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.