Jump to content

mysql help


somo

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";

}
Link to comment
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
Link to comment
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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.