Jump to content

[SOLVED] Insert Problem


timmah1

Recommended Posts

Why when I use following code, does it only insert the first character of every $_POST instead of the full $_POST?

<?php
$count = count($_POST['pack']);
for ($i = 0; $i < $count; $i++) {


			$price1 = "comp";
			$processor = "Admin Insert";


			$price = $price1[$i];
			$processor = $processor[$i];			
			$email = $_POST['email'][$i];
			$pass = $_POST['pass'][$i];			
			$exp = $_POST['yr']."-".$_POST['month']."-".$_POST['day'][$i];				
			$val = $_POST['pack'][$i];

			$sql = "INSERT INTO members1(package, price, email, password, processor, purchase, exp) VALUES(
								'$val',
								'$price',
								'$email',
								'$password',
								'$processor', 
								NOW(),
								'$exp');";
								mysql_query($sql)
								or die("Sorry, there was a problem creating your account ".mysql_error());	
}
?>

 

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/151683-solved-insert-problem/
Share on other sites

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.