Hi,
in my database table, i have inserted the following data after creating the appropriate tables:
im building section of an application which needs to check for all transactions between two dates. I do this by:
When i run this straight from the mysql command line, i get the 3 above results. When i run the same query in my application, with some added sql functions:
i only get the first result. Im pretty sure that it has to do with the array being returned only having 1 row so how do i use PHP to print out the other rows?
i havent been very successful with google :(
thank you
in my database table, i have inserted the following data after creating the appropriate tables:
Code:
insert into Transaction values(0001, null, 'BransenEnt', 1, 'Mastercard', 99.99, '2010-06-05', '10:00:00'); insert into Transaction values(0002, 'blackbear62', null, null, 'Visa', 29.99, '2010-01-03', '13:47:00'); insert into Transaction values(0003, null, 'JoeRod', 2, 'Visa', 99.99, '2009-07-22', '17:15:00');
Code:
$query = "SELECT * FROM Transaction WHERE Date between \"2009-06-12\" AND \"2010-07-05\" ";
Code:
$query = "SELECT * FROM Transaction WHERE Date between \"2009-06-12\" AND \"2010-07-05\" "; $result = mysql_query($query); $array = mysql_fetch_assoc($result); print_r($array);
i havent been very successful with google :(
thank you
Comment