View Single Post
  #1 (permalink)  
Old 11-30-2007, 08:27 AM
mikejkellyuk mikejkellyuk is offline
Novice
Join Date: Nov 2007
Posts: 8
iTrader: (0)
mikejkellyuk is on a distinguished road
[SOLVED] hlep with mysql between function

can anybody body tell me why this code is not working it is ment to seach between two date and bring back all the data between though dates

PHP Code:
<?php
$link 
mysql_connect("localhost","username","password");
if (!
$link)  {  die('Could not connect: ' mysql_error());
  }
mysql_select_db("mikejkel_addressbook"$link);
$result mysql_query("SELECT date, firstname, mon, tue, wed, thu, fri, workaweek FROM hoursworked WHERE date BETWEEN '2007/11/04' AND '2007/11/30'");
echo 
"<table border='1'>
<tr>
<th>date</th>
<th>firstname</th>
<th>mon</th>
<th>tue</th>
<th>wed</th>
<th>thu</th>
<th>fri</th>
<th>hours worked that week</th>
</tr>"
;
while(
$row = @mysql_fetch_array($result));  
{  
echo 
"<tr>";
echo 
"<td>" $row['date'] . "</td>";
echo 
"<td>" $row['firstname'] . "</td>";
echo 
"<td>" $row['mon'] . "</td>";
echo 
"<td>" $row['tue'] . "</td>";
echo 
"<td>" $row['wed'] . "</td>";
echo 
"<td>" $row['thu'] . "</td>";  
echo 
"<td>" $row['fri'] . "</td>";  
echo 
"<td>" $row['workaweek'] . "</td>";   
echo 
"</tr>";
  }echo 
"</table>";
 
 
mysql_close($link);
?>
any help would be good
thanks
mike

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!