Re: MSQL and php creating problem with date..

From: Date: Tue, 16 Jan 2001 02:48:08 +0000
Subject: Re: MSQL and php creating problem with date..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-34742@lists.php.net to get a copy of this message
> ***************************************************** > You have an error in your SQL syntax near > 'dayofmonth(date_add('', INTERVAL 7 DAY)))' at line 2 > ***************************************************** > > > > <?php > > $odate = date('Y m d'); > > $connect = mysql_connect("localhost"); > > What is $odate_sql supposed to be? It's blank, and SQL doesn't like that. I think you want just $odate there, only you may need to format it differently for mysql... Check the docs at http://mysql.org for the date formats it will accept. > $query = "insert into list(odate,edate) > values($odate,dayofmonth(date_add('$odate_sql', > INTERVAL 7 DAY))"; > > $execute = mysql_db_query("dubaiteenz",$query); > if($execute) > { > echo "Success, you are thinking in the right > direction"; > } > else > { > echo mysql_error(); > } > > > ?> > > > > > > Can anybody help me out please.... > > > Thanx! > Dhaval Desai > > > > > > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#34742) next »