JJohnsenDK Posted May 24, 2007 Share Posted May 24, 2007 Hey Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again??? Whats wrong? Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/ Share on other sites More sharing options...
Dragen Posted May 24, 2007 Share Posted May 24, 2007 what's your code? Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/#findComment-260646 Share on other sites More sharing options...
JJohnsenDK Posted May 24, 2007 Author Share Posted May 24, 2007 <?php include(LOCALE.LANGUAGES."order.php"); if(isset($_POST['payment_submit'])){ //Tjekker om der er farlig kode. if(is_num($_POST['card_no']) && is_num($_POST['month']) && is_num($_POST['year']) && is_num($_POST['control_no'])){ //Kryptere informationerne inden de bliver gemt i databasen $encrypt_month = $_POST['month']; $encrypt_year = $_POST['year']; $encrypt_control_no = $_POST['control_no']; //Henter kundens indkøbsvognsinformationer $cartQuery = mysql_query("SELECT items, color, product_product_id, payment_method FROM shop_cart WHERE temp_id = '".$_SESSION['cart_id']."'") or die(mysql_error()); $cartRow = mysql_fetch_array($cartQuery); //Sætter informationerne ind i databasen $insertQuery = mysql_query("INSERT INTO faktura SET product_product_id = '".$cartRow['product_product_id']."', user_id = '".username_to_id($_SESSION['username'])."', card_no = '12345678912', expiring_month = '".$encrypt_month."', expiring_year = '".$encrypt_year."', control_no = '".$encrypt_control_no."', items = '".$cartRow['items']."', color = '".$cartRow['color']."', total_amount = '".$_SESSION['total']."', date = NOW(), temp_id = '".$_SESSION['cart_id']."'") or die(mysql_error()); //Printer faktura til bruger $orderQuery = mysql_query("SELECT product_product_id, items, color, total_amount, date FROM faktura WHERE temp_id = '".$_SESSION['cart_id']."'") or die(mysql_error()); $orderRow = mysql_fetch_array($orderQuery); ?> <div class="shop_order_main"> <div class="shop_order_date"> <p> <?php echo $lan['006']; ?>: <?php echo set_date($orderRow['date']); ?><br /> Højbro Kontormontering A/S </p> </div> <div> <h4><?php echo $lan['007']; ?></h4> <p><b><?php echo $lan['005']; ?> <?php echo $orderRow['order_id']; ?></b></p> </div> <div> <table> <tr> <td><?php echo $lan['001']; ?></td> <td><?php echo $lan['002']; ?></td> <td><?php echo $lan['003']; ?></td> <td><?php echo $lan['004']; ?></td> </tr> <?php while($productRow = mysql_fetch_array($orderQuery)){ echo "<tr><td>".get_product_name($productRow['product_product_id'])."</td></tr>"; } ?> </table> </div> </div> <?php } } ?> And its the table card_no where it goes wrong. Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/#findComment-260649 Share on other sites More sharing options...
Dragen Posted May 24, 2007 Share Posted May 24, 2007 hmm.. looks fine to me. what kind of table cell is it? I presume it's int Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/#findComment-260656 Share on other sites More sharing options...
AndieB Posted May 24, 2007 Share Posted May 24, 2007 In the database for the table where that number sets default, what is the type of datatype in that column? (i.e. INT) Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/#findComment-260657 Share on other sites More sharing options...
JJohnsenDK Posted May 24, 2007 Author Share Posted May 24, 2007 yes its int(18) and no default value or anything else... Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/#findComment-260663 Share on other sites More sharing options...
JJohnsenDK Posted May 24, 2007 Author Share Posted May 24, 2007 anyone who has any ideas? This happens nomather what in my database. I tried to create a brand new table, but same problem... as soon i hit 11 numbers in one number it stores that number?? Quote Link to comment https://forums.phpfreaks.com/topic/52795-database-stores-default-number-everytime-but-i-havent-set-a-default-number/#findComment-260740 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.