Jump to content


date field doesnt work

  • Please log in to reply
No replies to this topic

#1 NorthWind

  • Members
  • PipPip
  • Member
  • 10 posts

Posted 19 May 2006 - 02:31 AM

        echo "<table align='center' border='0' cellpadding='6' cellspacing='3'>";
        echo "<td height='406' valign='center' align='center'>";

        $cname = $_POST['cname'];
        $sno = $_POST['sno'];
        $tref = $_POST['tref'];
        $accno = $_POST['accno'];
        $service = $_POST['service'];
        $speed = $_POST['speed'];
        $data = $_POST['data'];
        $rdate = $_POST['realDate'];
        $owed = $_POST['owed'];
        $paid = $_POST['paid'];
        $querycnt = "SELECT * from telstra";
        $resultcnt = mssql_query($querycnt, $link);
        $num_itemscnt = mssql_num_rows($resultcnt);
        if ($num_itemscnt <= 0)
            { $num_itemscnt=1;}
        $query = "INSERT INTO telstra (id, custname, servno, telstraref, accno, service, speed, data, datesubmit, cown, cpaid) VALUES ('$num_itemscnt', '$cname', '$sno', '$tref', '$accno', '$service', '$speed', '$data', '$rdate', '$owed', '$paid')";

        $result = mssql_query($query, $link);

        if ($result) 
            echo $rdate;
            echo "<h3>Success ! \n";
            echo "<p>$cname has been added to the database.";
            echo "<p><a href='telstra_list.php'>List All Customers' Subscriptions </a> \n";
            echo "<h2>error with database! - Customer May Already Exist";
        echo "</td>";
        echo "</table>";


i got some stuff from the previous page with post, then enter em to the db. the problem is the datefield does not get written to the db. I echo it too to check i get it or not, it gets it ok and shows 19/05/2006 but when i check the db, i c <NULL>.
the db field for date is datetime with 8 lenght and allow nulls.
any ideas guys? thanks

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users