Jump to content

Database stores default number everytime, but i havent set a default number??


JJohnsenDK

Recommended Posts

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?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.