Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 918 results for
curdate()
- Page 1
CURDATE is not working
Programming
Web Development
12 Years Ago
by PF2G
…gt; $noticia) { echo $noticia['date'] < $
curdate
; die; $query_data=mysql_query("SELECT * FROM noticias WHERE data…data=mysql_fetch_assoc($query_data); if ($data['data'] < $
curdate
) { echo "<label>".formatdate($…
Re: Curdate() problems
Programming
Web Development
15 Years Ago
by CFROG
… fields into XINFO $sql = "INSERT INTO xinfo (date_submit) VALUE (
CURDATE
())"; [/code] Instead of the way I had it [code…
Curdate() problems
Programming
Web Development
15 Years Ago
by CFROG
…;INSERT INTO xinfo SET date_submit='$dsub', //<-- set to $dsub = '
CURDATE
()'; first_name='$fn', last_name='$ln', city='$city', state_province='$state', country='$cntry…
Re: Curdate() problems
Programming
Web Development
15 Years Ago
by jcacquiescent27
I think you'll find that the example [URL="http://www.tizag.com/mysqlTutorial/mysql-date.php"]at this page[/URL] will shed light on the problem. Just from a glance, and not being set up to test it, I'd say to change [icode]date_submit='$dsub'[/icode] to [icode]date_submit=
CURDATE
()[/icode].
Re: Assigning curdate() to a variable
Programming
Web Development
15 Years Ago
by Aamit
…;http://www.gizmola.com/blog/archives/51-Exploring-Mysql-
CURDATE
-and-NOW.-The-same-but-different..html"]http://…www.gizmola.com/blog/archives/51-Exploring-Mysql-
CURDATE
-and-NOW.-The-same-but-different..html[/URL] [URL…;http://www.smallsql.de/doc/sql-functions/date-time/
curdate
.html"]http://www.smallsql.de/doc/sql-functions/…
replace curdate() - interval with $variable - interval
Programming
Web Development
12 Years Ago
by adishardis
… get the second week etc. FROM my_db WHERE DATE >=
CURDATE
() - INTERVAL 10 ".$grouping1." GROUP BY ".$grouping…1 I have two questions: I would like to exchange
curdate
() with a variable instead so that we are able …way to do this? I've tried to exchange the
curdate
with a variable like this: FROM my_db WHERE DATE &…
Using SQL CURDATE() Interval
Programming
Databases
12 Years Ago
by davidjennings
Hi all - use the
curdate
() or current date to look at newly added awards in …' , 'P') AND tbl_region.region_ID = '3' AND 'tbl_net_centre.reg-date' <=(
CURDATE
(), INTERVAL 3 MONTH) group by tbl_centre.centre_id having Nunmber_of_New_networks =1…
Re: Using SQL CURDATE() Interval
Programming
Databases
12 Years Ago
by imBaCodes
….w3schools.com/sql/func_now.asp) While on the other hand **
CURDATE
()** retruns only a portion of the current date. Its a… big advantage using NOW() . [
CURDATE
()](http://www.w3schools.com/sql/func_curdate.asp)
Re: date = curdate
Programming
Databases
13 Years Ago
by mrhankey
i have even tried changing it to this: [CODE]SELECT count(TaskID) AS DueToday, DATE_FORMAT(`TaskDueDate`,'%Y-%m-%d') AS XLABEL FROM tasks WHERE 'XLABEL' =
CURDATE
( ) AND Completed = 'No'[/CODE] i think it is the
curdate
( ) that is causing the issue however i have tried NOW() and still does not work.
Re: date = curdate
Programming
Databases
13 Years Ago
by simplypixie
… all lower case and got the result as expected (using
CURDATE
()). So the code (which is a bit more simple than…(TaskDueDate, '%d.%m.%Y') as xlabel FROM tasks WHERE TaskDueDate =
CURDATE
() AND Completed = 'No'[/CODE]
Re: Using SQL CURDATE() Interval
Programming
Databases
12 Years Ago
by rch1231
Hello, I think you are missing the DATE_ADD and have the wrong quote marks around the field name. Try something like this from the mysql manual: SELECT something FROM tbl_name WHERE `tbl_net_centre.reg-date` <= DATE_ADD(
CURDATE
(),INTERVAL 3 MONTH) ;
Assigning curdate() to a variable
Programming
Web Development
15 Years Ago
by levsha
I know it's a dumb question, but I can't figure it out. What's wrong with this code? - [CODE]$progress_report =
curdate
();[/CODE] It doesn't work. Thank you!
date = curdate
Programming
Databases
13 Years Ago
by mrhankey
…(`TaskDueDate`,'%d.%m.%Y') AS XLABEL FROM tasks WHERE 'XLABEL' =
CURDATE
( ) AND Completed = 'No'[/CODE] however it returns 0 TaskDueDate column…
Re: date = curdate
Programming
Databases
13 Years Ago
by simplypixie
Try changing [CODE]
CURDATE
()[/CODE] to [CODE]date('Y-m-d')[/CODE]
Re: CURDATE is not working
Programming
Web Development
12 Years Ago
by diafol
Ordering by d/m/Y won't work - you need to order by Y-m-d. Also comparison by d/m/Y won't work ALso where do you filter out the future date in the original WHERE clause? Can't see why you've got sql query in a loop here - can't you use a JOIN? If you need to show d/m/Y, IMO, store everything and order/compare by Y-m-d or even unix timestamp and…
Re: replace curdate() - interval with $variable - interval
Programming
Web Development
12 Years Ago
by pritaeas
> the weeks/months stay the same even though the variable (start date) changes Can you provide an example of what happens?
Re: Using SQL CURDATE() Interval
Programming
Databases
12 Years Ago
by imBaCodes
And **rch1231** is correct . you better try it out. It would be better to use NOW()..
Re: Using SQL CURDATE() Interval
Programming
Databases
12 Years Ago
by davidjennings
Hi Both thanks for your comments. Can you explain why you NOW() would be better, I know you can use that on insert to db. Can you give an example Thanks d
Re: Using SQL CURDATE() Interval
Programming
Databases
12 Years Ago
by davidjennings
Thanks
Re: Assigning curdate() to a variable
Programming
Web Development
15 Years Ago
by praveen_dusari
try [CODE]$progress_report=date();[/CODE] it will work
Re: Assigning curdate() to a variable
Programming
Web Development
15 Years Ago
by levsha
Thank you!
Re: Assigning curdate() to a variable
Programming
Web Development
15 Years Ago
by levsha
Now, this [CODE]$progress_report = date("Y-m-d"); [/CODE] works, but when I try to do some date math - like add a month to the current date, it doesn't. I tried these: [CODE]$progress_report = strtotime(date("Y-m-d", strtotime($progress_report)) . " +1 month"); $progress_report = mktime(0, 0, 0, date("m")+…
Re: Assigning curdate() to a variable
Programming
Web Development
15 Years Ago
by levsha
Never mind, I figured that out.
Re: date = curdate
Programming
Databases
13 Years Ago
by mrhankey
no still does not return and count of tasks due today. anything else i can try?
Re: date = curdate
Programming
Databases
13 Years Ago
by simplypixie
Just realised your column to compare with today's date is formatted incorrectly, should be: [CODE] SELECT count(TaskID) AS DueToday, DATE_FORMAT(`TaskDueDate`,'%Y-%m-%d') AS XLABEL FROM tasks WHERE `XLABEL` = date('Y-m-d') AND Completed = 'No' [/CODE] You had ' ' around the XLABEL which is incorrect, is using quotes around column names they should…
Re: date = curdate
Programming
Databases
13 Years Ago
by mrhankey
thanks for this, XLABEL is not a column in the database, TaskDueDate is the column i am using XLABEL as an alias as i need to trim TaskDueDate column from a datetime type to just the date. i ran your query however no joy. thanks again
Re: date = curdate
Programming
Databases
13 Years Ago
by simplypixie
Oh yes, I had missed that - you can't use an alias like you are. Just change the where clause to use your correct column [CODE]WHERE TaskDueDate = date('Y-m-d')[/CODE]
Re: date = curdate
Programming
Databases
13 Years Ago
by mrhankey
yeah thanks for that, only issue is it returns 0 back where there is definately an entry. really strange.
Re: date = curdate
Programming
Databases
13 Years Ago
by mrhankey
strange thing is the overdue query i have works fine [CODE]SELECT COUNT(tasks.TaskID) AS TasksDue, tasks.TaskDueDate, tasks.Completed FROM tasks WHERE tasks.TaskDueDate < CURRENT_DATE() and tasks.Completed = 'No'[/CODE] i did try changing it to [CODE]tasks.TaskDueDate = CURRENT_DATE()[/CODE] but no joy
Re: date = curdate
Programming
Databases
13 Years Ago
by simplypixie
Have you tried running the query in PHPMyAdmin (obviously putting in some data in place of the variables) and see what happens? It should give you an error message if it is your query that isn't working.
1
2
3
16
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC