...

View Full Version : Date not inserting into database?!



jarv
12-11-2010, 09:00 PM
Hi,

When I post a date as dd/mm/yyyy from HTML form into my date field (data type: date) it just shows as NULL?!



if(isset($_POST["register"])) {
// Your code here to handle a successful verification
$RSTOWN = $_POST["'rsTown'"];
$rsGender = $_POST['rsGender'];
$RSUSER = $_POST['RSUSER'];
$RSPASS = $_POST['RSPASS'];
$rsEmail = $_POST['rsEmail'];
$rsMobile = $_POST['rsMobile'];
$rsAge = $_POST['rsAge'];

$to = 'info@mypubspace.com, '.$rsEmail;

//define the subject of the email
$subject = 'Welcome '.$RSUSER.' to My Pub Space';

// message
$message = '
<html>
<head>
<title>'.$subject.'</title>
</head>
<body>
<table>
<tr>
<td>Name:</td>
<td>'.$RSUSER.'</td>
</tr>
<tr>
<td>Email:</td>
<td>'.$rsEmail.'</td>
</tr>
<tr>
<td>Town:</td>
<td>'.$rsTown.'</td>
</tr>
<tr>
<td>Telephone:</td>
<td>'.$rsMobile.'</td>
</tr>
<tr>
<td>Age:</td>
<td>'.$rsAge.'</td>
</tr>
<tr>
<td>Password:</td>
<td>'.$RSPASS.'</td>
</tr>
</table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To:' .$to. "\r\n";
$headers .= 'From:' .$rsEmail. "\r\n";


// Mail it
mail($to, $subject, $message, $headers);

$sql = "INSERT INTO members_copy (RSTOWN, RSGENDER, RSUSER, RSPASS, RSEMAIL, RSMOBILE, RSAGE) VALUES ('$rsTown', '$rsGender', '$RSUSER', '$RSPASS', '$rsEmail', '$rsMobile', '$rsAge');";
//echo $sql;
mysql_query($sql);


Please help?!

seco
12-11-2010, 10:56 PM
make it varchar(30)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum