seriously neeed help!
Posted: Wed Dec 02, 2009 7:22 am
i am working on a php/mysql project and right now i am stuck and need help fast.
what i want to do is echo out a row with 2n cells what i mean is:
row1 wld have 2 cells
row 2 wld have 4 rows
row 3 wld have 8 rows etc.
my php codes are :
<?php
echo "table border=1>";
require_once "connector.inc" - # for the connector strings
require_once "tree.inc" - # for the mysql commands which is just a normal MySQL SELECT query
if($result=mysql_query($sql)){
while($row=mysql_fetch_assoc($result)){
$count=1; - # to initiate the count for the number of cells i want
echo "<tr>";
$ab =pow(2,$count); - #to limit the number of cells per row
$i=1;
do{
echo "<td>";
echo $i;
$studentname=current($row);
echo $studentname;
echo "</td>";
}
i++;
echo "</tr>";
}
}
}
echo "</table>";
I have tried to find out what i am doing wrong but i don;t seem to get it.
I wld love to use OOP but right now, i am still studying it.
Thanks alot for your help
what i want to do is echo out a row with 2n cells what i mean is:
row1 wld have 2 cells
row 2 wld have 4 rows
row 3 wld have 8 rows etc.
my php codes are :
<?php
echo "table border=1>";
require_once "connector.inc" - # for the connector strings
require_once "tree.inc" - # for the mysql commands which is just a normal MySQL SELECT query
if($result=mysql_query($sql)){
while($row=mysql_fetch_assoc($result)){
$count=1; - # to initiate the count for the number of cells i want
echo "<tr>";
$ab =pow(2,$count); - #to limit the number of cells per row
$i=1;
do{
echo "<td>";
echo $i;
$studentname=current($row);
echo $studentname;
echo "</td>";
}
i++;
echo "</tr>";
}
}
}
echo "</table>";
I have tried to find out what i am doing wrong but i don;t seem to get it.
I wld love to use OOP but right now, i am still studying it.
Thanks alot for your help