Jump to content

Archived

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

somo

mysql help

Recommended Posts

i realise the code below is cr@p but can any one tell me how i can retrieve all todays dates (i.e. $Todays_Date) and return the number of rows that exist in all of the "B_Checkout" field this is all i need .  Can any one help i realise this is simple and will kick myself when im told but i have been workin for to long and my brain is warped lol


What ive got at mo:
$result = mysql_query("SELECT B_CheckoutDate FROM Bookings WHERE B_CheckoutDate = ".$Todays_Date." ") or die(mysql_error());
while ($get_info = mysql_fetch_row($result)){

foreach ($get_info as $field)
print "\t<td><p>$field</p></td>\n";

}

Share this post


Link to post
Share on other sites
What format are B_CheckoutDate and $Todays_Date? If they are formatted as YYYY-MM-DD, try this:
[code]<?php
$q = "SELECT B_CheckoutDate FROM Bookings WHERE B_CheckoutDate = '$Todays_Date'";
$rs = mysql_query($q) or die("Problem with query: $q<br>" . mysql_error());
while ($row = mysql_fetch_assoc($rs))
    echo "\t<td>" . $row['B_CheckoutDate'] . "</td>\n";
?>[/code]

Ken

Share this post


Link to post
Share on other sites
that isn't doing anything (and theres not even errors  ???)

the format is D M Y e.g. 09 July 2006.

i just need the amount of fields in the database that have todays date.

if there are 2 fields with 11 July for example (i need a variable to store 2)

any ideas?

Share this post


Link to post
Share on other sites

×

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.