Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question Date not inserting into database?!

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

    Code:
    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?!

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    make it varchar(30)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •