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
https://forums.phpfreaks.com/topic/14339-mysql-help/
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
https://forums.phpfreaks.com/topic/14339-mysql-help/#findComment-56520
Share on other sites

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.