| | |
Help me with this msql query!
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 16
Reputation:
Solved Threads: 0
I would like to query regulation which it's date reminder is >= today and it's date ended is >=today.
So I came with this query:
It works on postgerSQL but not on mysql
I dont why It couldn't work on mySQL
Please help me to revise this query
So I came with this query:
PHP Syntax (Toggle Plain Text)
$query="select * from t_regulation where dt_reminder >= '$today' and dt_ended ='$today'"
It works on postgerSQL but not on mysql
I dont why It couldn't work on mySQLPlease help me to revise this query
•
•
Join Date: Apr 2008
Posts: 293
Reputation:
Solved Threads: 11
PHP Syntax (Toggle Plain Text)
echo $query="select * from t_regulation where dt_reminder >= '$today' and dt_ended ='$today'";
copy the output of echo statement and execute in mysql check whether query gives correct result or not.
if you got correct output then write..
PHP Syntax (Toggle Plain Text)
$sql=mysql_query($query);
Last edited by Aamit; May 20th, 2009 at 9:57 am.
•
•
Join Date: Apr 2009
Posts: 16
Reputation:
Solved Threads: 0
table structure is:
t_master_reg
--------------------------------------------------------
|field | type data |
--------------------------------------------------------
id_reg |VARCHAR
no_reg |VARCHAR
reg_subject | VARCHAR
dt_reg_stated | DATE
dt_reg_end | DATE
dt_reg_reminder | DATE
values ('1','regulation no 546','regulation subject','2009-05-05','2009-07-31','2009-06-31')
Here is my code
if I executed the query it will return an empty result. What should I do.Please help me..
t_master_reg
--------------------------------------------------------
|field | type data |
--------------------------------------------------------
id_reg |VARCHAR
no_reg |VARCHAR
reg_subject | VARCHAR
dt_reg_stated | DATE
dt_reg_end | DATE
dt_reg_reminder | DATE
values ('1','regulation no 546','regulation subject','2009-05-05','2009-07-31','2009-06-31')
Here is my code
PHP Syntax (Toggle Plain Text)
$query = 'SELECT * FROM t_master_reg dt_reg_reminder >= '$today' AND dt_reg_end >='$today' ';
if I executed the query it will return an empty result. What should I do.Please help me..
•
•
Join Date: Jun 2008
Posts: 3
Reputation:
Solved Threads: 1
•
•
•
•
I would like to query regulation which it's date reminder is >= today and it's date ended is >=today.
So I came with this query:
PHP Syntax (Toggle Plain Text)
$query="select * from t_regulation where dt_reminder >= '$today' and dt_ended ='$today'"
It works on postgerSQL but not on mysqlI dont why It couldn't work on mySQL
Please help me to revise this query
http://www.w3schools.com/php/php_ref_date.asp
•
•
Join Date: Apr 2009
Posts: 16
Reputation:
Solved Threads: 0
•
•
•
•
Hi u can refer the following link, It might help u to solve ur problem.
http://www.w3schools.com/php/php_ref_date.asp
thank fo the link but I haven't yet found the solution. It still not work on mySQL
•
•
Join Date: May 2009
Posts: 1
Reputation:
Solved Threads: 1
•
•
•
•
I would like to query regulation which it's date reminder is >= today and it's date ended is >=today.
So I came with this query:
PHP Syntax (Toggle Plain Text)
$query="select * from t_regulation where dt_reminder >= '$today' && dt_ended ='$today'"
It works on postgerSQL but not on mysqlI dont why It couldn't work on mySQL
Please help me to revise this query
![]() |
Similar Threads
- Sql Query (VB.NET)
- MySQL - guidance on multiple WHERE clause (MySQL)
- how to view image in Msql (PHP)
- Removing Query Strings (ASP.NET)
- Double MySQL Query (PHP)
- Dynamic Query (JSP)
- SQL Server vs MYSQL vs MSQL (i'm stopping now) (MS SQL)
- Retreiving variables from a sql query into a form (PHP)
- Query Building (Database Design)
Other Threads in the PHP Forum
- Previous Thread: Generate new password every 24 hours?
- Next Thread: How to inform that the query result zero rows?
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date development directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube






