Hello
I have to make a menu for a restaurant and I am kind of rookie at MySQL ..
The menu has to be 8 columns wide ( 1column + 7 days ) and 8 rows in height .
The problem is that it needs to be fully customisable , some cells having certain color and other stuff like that . So I can't use the table script i usually use .
I started this code , but got a problem . I don't know how to load a value from the database as variable in php .
I simplified the table so it's a lot easier to understand it .
Also , my database is currently set up like this :
ID.....POSITION......TEXT
1........r1c1............TEXT_r1c1
2........r1c2............TEXT_r1c2
.......
63.......r8c7............TEXT_r8c7
64.......r8c8............TEXT_r8c8
<?php
include_once"config.php";
$query = mysql_query("SELECT * FROM DB_NAME");
$r1c1 = $value1_from_db; <!-- TEXT_r1c1 -->
$r1c2 = $value2_from_db; <!-- TEXT_r1c2 -->
.....
$r8c8 = $value64_from_db;
?>
<table width="900" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><? echo $r1c1 ?></td> <!-- Row 1 , column 1 -->
<td><? echo $r1c2 ?></td> <!-- Row 1 , column 2 -->
<td><? echo $r1c3 ?></td> <!-- Row 1 , column 3 -->
<td><? echo $r1c4 ?></td> <!-- Row 1 , column 4 -->
<td><? echo $r1c5 ?></td> <!-- ................ -->
<td><? echo $r1c6 ?></td>
<td><? echo $r1c7 ?></td>
<td><? echo $r1c8 ?></td>
</tr>
<tr>
<td><? echo $r2c1 ?></td>
<td><? echo $r2c2 ?></td>
<td><? echo $r2c3 ?></td>
<td><? echo $r2c4 ?></td>
<td><? echo $r2c5 ?></td>
<td><? echo $r2c6 ?></td>
<td><? echo $r2c7 ?></td>
<td><? echo $r2c8 ?></td>
</tr>
<tr>
<td><? echo $r3c1 ?></td>
<td><? echo $r3c2 ?></td>
<td><? echo $r3c3 ?></td>
<td><? echo $r3c4 ?></td>
<td><? echo $r3c5 ?></td>
<td><? echo $r3c6 ?></td>
<td><? echo $r3c7 ?></td>
<td><? echo $r3c8 ?></td>
</tr>
<!-- Here are 5 more rows of 8 columns each -->
</table>
Thanks in advance for any hint or guide .