Jump to content

data table help plz?


davithedork

Recommended Posts

hi, could someone please help me? i've posted here a while ago, but got no reply.  i'm in desprite need to make the page a certain look.  but am having problem.  i got everything to work, just, i need it to be displayed a certain way.

 

the page right now is www.downtownfashion.net/girl.php  and its being displayed wrong.

the way i want it is like this www.downtownfashion.net/help.jpg.  but i cant seem to get it.. been trying to figure it out for like almost 12 hrs.  i know.. sad.. :'(

 

here are the code:

 

// If current page number, use it

// if not, set one!

 

if(!isset($_GET['page'])){

    $page = 1;

} else {

    $page = $_GET['page'];

}

 

// Define the number of results per page

$max_results = 5;

 

// Figure out the limit for the query based

// on the current page number.

$from = (($page * $max_results) - $max_results);

 

// Perform MySQL query on only the current page number's results

 

$sql = mysql_query("SELECT * FROM flowergirl LIMIT $from, $max_results");

 

echo "<div align='center'>";

echo "<table border='1' width='800'>";

 

 

while($row = mysql_fetch_array($sql)){

echo "<td width='160' align='center'>";

 

 

    // Build your formatted results here.

 

echo "<tr><td>";

echo $row['brandname']."</td>";

echo "<td>";

echo $row['size']."</td>";

echo "<td>";

echo $row['styleno']."</td></tr>";}

 

 

 

 

 

// Figure out the total number of results in DB:

$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM flowergirl"),0);

 

// Figure out the total number of pages. Always round up using ceil()

$total_pages = ceil($total_results / $max_results);

 

// Build Page Number Hyperlinks

 

echo "<tr>Select a Page<br />";

 

// Build Previous Link

if($page > 1){

    $prev = ($page - 1);

    echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><<Previous</a> ";

}

 

for($i = 1; $i <= $total_pages; $i++){

    if(($page) == $i){

        echo "$i ";

        } else {

            echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> ";

    }

}

 

// Build Next Link

if($page < $total_pages){

    $next = ($page + 1);

    echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>";

}

echo "</center>";

?>

 

 

 

 

 

this is the coding part where i need help with:

echo "<tr><td>";

echo $row['brandname']."</td>";

echo "<td>";

echo $row['size']."</td>";

echo "<td>";

echo $row['styleno']."</td></tr>";}

 

i only put brandname size and styleno for now.  the rest i'll add later if i could get the help.  thank you.  please help me..  :)

Link to comment
https://forums.phpfreaks.com/topic/47632-data-table-help-plz/
Share on other sites

echo "<table border='1' width='800'>";

echo "<tr>";

while($row = mysql_fetch_array($sql)){

echo "<td width='160' align='center'>";

echo "<table border='1' width='800'>";

echo "<tr><td>";

echo $row['brandname'];

echo "</td></tr>";

echo "<tr><td>";

echo $row['size'];

echo "</td></tr>";

echo "<tr><td>";

echo $row['styleno']

echo "</td></tr>";

echo "<table>";

echo "</td>";

}

echo "</tr>";

echo "</table>";

Link to comment
https://forums.phpfreaks.com/topic/47632-data-table-help-plz/#findComment-232581
Share on other sites

echo "</table>";  // forgot to close the tabel //

 

echo "<table border='1' width='800'>";
echo "<tr>";
while($row = mysql_fetch_array($sql)){
   echo "<td width='160' align='center'>";
      echo "<table border='1' width='800'>";
         echo "<tr><td>";
         echo $row['brandname'];
         echo "</td></tr>";
         echo "<tr><td>";
         echo $row['size'];
         echo "</td></tr>";
         echo "<tr><td>";
         echo $row['styleno']
         echo "</td></tr>";
      echo "</table>";  // forgot to close the tabel //
   echo "</td>";
}
echo "</tr>";
echo "</table>";

Link to comment
https://forums.phpfreaks.com/topic/47632-data-table-help-plz/#findComment-232801
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.