Jump to content

[SOLVED] Mysql Where datefield = dataparam in PHP


silas101

Recommended Posts

Hi there.

 

i have 2 forms. form 1 inputs a string exactly 2009-01-05

 

second form has DateFrom field as

$dfrom = $_POST['datefrom'];

  (which is correct to use)?

$dto = $dateto;    (which is correct to use)?

 

i have sql query as

$result = mysql_query("SELECT branch_name,Date

FROM 'Payments'

WHERE Date = {$dfrom}

ORDER BY Branch,Date desc");

 

if i take out the where.. query gets results

if i use date value in where...eg '2009-07-17' it returns results

i am thinking the $dfrom parameter is getting no value and that is why i get no error and just empty results.

 

how do i get the value of the datefield on the previous form into my query?

 

Thank you sooooooo much

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.