here Iam trying to fetch two table data based on one column 'createdon' and my statement is like below
"SELECT * FROM table1 INNER JOIN table2 ON table1.createdon = table2.createdon WHERE table1.createdon AND table2.createdon BETWEEN '$fromdate' AND '$todate' ORDER BY id"
would anyone correct me please, if Iam wrong
Thanks you......
you shouldn't say
table1.createdon AND table2.createdon. You only need to test one of them, since theONcondition requires both rows to have the samecreatedonvalue.