I have a table with this info:
id ctype weeknum daynum posting
1 2 2 3 15.55
2 2 4 5 60.50
3 2 15 1 10.00
4 2 17 2 100.55
I wish to use the “posting” on the proper row and column using this loop.
for($row=1;$row<=52;$row++) // 52 weeks in a year
{
for($col=1;$col<=7;$col){ // 7 days in a week
$query=mysql_query("select * from table where ctype=2");
$weekday=mysql_fetch_array($query);
if($row==$weekday['weeknum'] && $col==$weekday['daynum']){
echo "<input type='text' value'".$posting['posting']."' />";
} else {
echo "<input type='text' />"; // will display a blank textbox
}
}
}
something like this is what i want to achieve. http://tvends.com/sample/sample.jpg
It should be something like this