Hi.
I've gotta Problem:
There're 5 columns named column1 to column5.
I wanted to select every entry in the table.
for ($i=1; $i <= 5; $i++) {
$sql_select = "SELECT column".$i." FROM test";
$result = mysql_query($sql_select, $db);
if($result) {
${"column".$i."_row"} = mysql_fetch_row($result); }}
The arrays fill up a table..
<?php echo $column1_row[0]; ?>
<?php echo $column1_row[1]; ?>
<?php echo $column1_row[2]; ?>
<?php echo $column1_row[...]; ?>
<?php echo $column2_row[0]; ?>
<?php echo $column1_row[1]; ?>
<?php echo $column1_row[...]; ?>
He writes the first row with index [0].
index[0] to index[...] failed:
Undefined offset: 1
He doesnt read
<?php echo $column1_row[1]; ?>
<?php echo $column2_row[1]; ?>
<?php echo $column3_row[1]; ?> etc.
Why?
Philipp