Results 1 to 2 of 2

Thread: help me

  1. #1
    Join Date
    Feb 2005
    Posts
    1

    Unanswered: help me

    i'm newbie in php language, so i want to know that how to convert the date from this format (dd/mm/yy) to the (mm/dd/yy). i'm using sql server that store the date data (mm/dd/yyyy). There was an error if i insert 13/1/04(dd/mm/yy) from the form as an instance. simply wanting the form to insert them in the new format. Moreover, the error displayd ([Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.)

    .
    .
    .
    if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO desk (date_no, price, code) VALUES (%s, %s, %s)",
    GetSQLValueString($HTTP_POST_VARS['date_no'], "date"),
    GetSQLValueString($HTTP_POST_VARS['price1'], "text"),
    GetSQLValueString($HTTP_POST_VARS['code1'], "text"));
    .
    .
    .

  2. #2
    Join Date
    Aug 2004
    Location
    San Antonio, TX
    Posts
    84
    Check out the "date" function in the PHP Manual.

Posting Permissions

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