Jump to content

HELP with data tables


soundpj

Recommended Posts

Hi Everyone ,

 

I am in need of some help and advice please , currently i am trying to modify some php script on my website which pulls back some data from a mysql query and then displays the data retrieved, currently it works fine for having 2 columns of data but i am unable to get it to produce 3 columns of data so i have a big gap where additional data can go.

 

The home page is www.shop4codes.co.uk and half way down you will see hot deals having now havng successfully widened the site trying to insert 3 columns of hotdeals instread of 2.

 

I have been out this the last 3 evenings spending 4/5 hours a time thinking that i will get here in the end ,  i am still relativley new to programming but learning all the time , hwever this time i must admit defeat.

 

 

I would appreciate any help possible or suggestions, below is the code pulling back the original 2 column data.

 

Where i am getting confused is to what signifcant the $out variable plays within the script

 

Many thanks if you can offer any help and assistance

 

Philip

 

 

 

SCRIPT

 

 

<center>

<table width="<? if($newdesignextrawidth != "25"){print $newdesignextrawidth + 354;}else{print "379";}?> border="0" cellspacing="0" cellpadding="0">

  <tr align="left">

      <td colspan='6'><p>

     

<? if($newdesign == "True")

{print "<hr><b><font face='Terminal'font color='<? print $newdesignheadertext; ?>'>HOT<font color='<? print $newdesignwelcometext; ?>'>DEALS</font></b></font>";}else{print "<img src='http://www.shop4codes.co.uk/images/hot.jpg' height='41' border='0' width='379'>";}?>

 

  </p><td>

  </tr>

 

<?php

 

if($hot_res && $HOME_DIR_HTTP)

{

?>

<?php

    $out = 1;

    while($hot_data = mysql_fetch_array($hot_res))

    {

        if($out == 1)

        {

            print "<tr align='center' valign='top'>\n";

            print "  <td width='10'>\n";

            print "  <td width='179'>\n";

 

        }

        else

            print "  <td width='180'>\n";

 

 

        print "<b><font face='verdana' size='2'><a class='catlink' href='$HOME_DIR_HTTP/go.php?m=".$hot_data[merchID]."&w=".urlencode($hot_data)."'>".$hot_data[name]."</a>".$hot_data[extra];

        print "<br>\n";

        print "<font size='2'>".$hot_data[description]."</font></font></b><hr>";

 

 

 

 

        print "  </td>\n";

        if($out == 2)

        {

            $out = 1;

            print "</tr>\n";

        }

        else

        {

            print "<td width='10'>&nbsp</td>\n";

           

            $out = 2;

        }

      }

}

else

    print "<tr><td>[NO HOT DEALS]</td></tr>\n";

 

?>

</table>

</center>

Link to comment
https://forums.phpfreaks.com/topic/175284-help-with-data-tables/
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.