Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Mysql Date Problem

    Hi, I am trying to get the date from a MYSQL server into a PHP page I am
    creating with Dreamweaver, I create a new recordset and go to advanced and
    enter the following query SELECT CURDATE() if I click test it returns the
    current date correctly, however as soon as I close the window the recordset
    displays MM_ERROR 1064 SQL Syntax Error and stops working. I am sure this is
    something really simple, what? Also the date is returned as Year-Month-Day ,
    can I change that to Day-Month-Year with + something?

    Scorpio_Boy Guest

  2. Similar Questions and Discussions

    1. date query problem, date in variable
      I am using the following query : $query_archief = "SELECT * FROM vacatures where dd_eind_plaatsing < $dd_eind_plaatsing_archief1" note:...
    2. php-mysql date problem
      Hello, I'm new to php and mysql and I use Dreamweaver MX 2004, so sorry for this "newbie" question... I've found no answer in the forum ... I've...
    3. PHP Date into MySQL
      Hi, I have the following script that is installed to obtain the date 7 days into the future and display 1 weeks worth of dates (minus Sunday). I...
    4. problem with date from MySQL
      I've this date in my MySQL database: 2003-12-29 18:24:20 now, in my PHP code, I'm trying to show only the date in a table's cell. Here is...
    5. date mysql
      Hi I have troubles with converting a date value to unixtime! In mysql I have a table named date TYPE "DATE" (2003-09-05) Now I want it to convert...
  3. #2

    Default Re: Mysql Date Problem

    Scorpio_Boy wrote:
    > Hi, I am trying to get the date from a MYSQL server into a PHP page I am
    > creating with Dreamweaver, I create a new recordset and go to advanced and
    > enter the following query SELECT CURDATE() if I click test it returns the
    > current date correctly, however as soon as I close the window the recordset
    > displays MM_ERROR 1064 SQL Syntax Error and stops working. I am sure this is
    > something really simple, what? Also the date is returned as Year-Month-Day ,
    > can I change that to Day-Month-Year with + something?
    I don't know why Dreamweaver does that, but it's rather pointless using
    MySQL to display the current date. PHP does that for you with the
    greatest of ease, and in the order you want:

    <?php echo date('d-m-Y'); ?>

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

  4. #3

    Default Re: Mysql Date Problem

    Thank you for the response, i know I can get the info from php, but i
    particularly want to use a mysql query so that i can display the info within a
    form and then use it as part of a record that gets submitted back into the
    database. I have made other custom recordsets work in the past and I'm really
    trying to find the reason why this one won't work...

    Scorpio_Boy Guest

  5. #4

    Default Re: Mysql Date Problem

    Scorpio_Boy wrote:
    > Thank you for the response, i know I can get the info from php, but i
    > particularly want to use a mysql query so that i can display the info within a
    > form and then use it as part of a record that gets submitted back into the
    > database.
    The problem with trying to do that is that your date will still be in
    the wrong format for MySQL. Why not just amend your insert statement to
    set your date column as CURDATE()?

    --
    David Powers
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    Co-author "PHP Web Development with DW MX 2004" (Apress)
    [url]http://computerbookshelf.com[/url]
    David Powers Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139