i have setup phemplate for my website and am very pleased but i coded a few things and they work thats a first but when i put them on the page it dont work.. this is portion of code:


<tr>
<td background="images/site/block_top.jpg" width="155" height="28" style="color: #FFFFCC"><center>
Affiliates</center>
</td>
</tr>
<tr>
<td width="155" height="19" bgcolor="#021803" background="images/site/block_bg.jpg">
<?php $rs = mysql_connect( "localhost", "MY USER", "MY PASS" );
$rs = mysql_select_db( "nova-zone" );
// Sql query for entries//
$sql = "select * from affiliates order by affname desc limit 10";
$rs = mysql_query( $sql);
//loop through records writeing a bullet for each//
while ( $row = mysql_fetch_array( $rs ) )
{
?>
<li><a href='<?php echo $row["affurl"]; ?>'><?php echo $row["affname"]; ?></a></li>
<?php } ?>

</td>
</tr>
<tr>
<td width="155" height="10" background="images/site/block_bottom.jpg"></td>
</tr>

</table>

thats the affiliates block on my site... when the code is there it dont work.. now if i put the code by itself it works fine..

EX:

<?php $rs = mysql_connect( "localhost", "MY USER", "MY PASS" );
$rs = mysql_select_db( "nova-zone" );
// Sql query for entries//
$sql = "select * from affiliates order by affname desc limit 10";
$rs = mysql_query( $sql);
//loop through records writeing a bullet for each//
while ( $row = mysql_fetch_array( $rs ) )
{
?>
<li><a href='<?php echo $row["affurl"]; ?>'><?php echo $row["affname"]; ?></a></li>

<?php } ?>

that works.

a have some other codes that dont work ether..

i have asked around but no one i know knows whats wrong...

Thanks in advance

    What do you mean by 'not working'? What errors are you getting?

      im not.. it works great by itself.. but when i put it in a page using phemplate it stops working no errors or anything its just blank..

      also.. can i change this line:

      $sql = "select * from affiliates order by affname desc limit 10";

      to this?

      $sql = "select * from affiliates order by affname";

      im new to php this is a modded guestbook script.. lol.. :o

      EDIT:

      1.jpg is script on the site..

      2.jpg is the script by itself in action..

        Umm... Im really not sure... AT ALL...
        But I suppose you could give this a try:

        <?php $rs = mysql_connect( "localhost", "MY USER", "MY PASS" );
        $rs = mysql_select_db( "nova-zone" );
        // Sql query for entries//
        $sql = "select * from `affiliates` order by `affname` desc limit 10,0";
        $rs = mysql_query( $sql);
        //loop through records writeing a bullet for each//
        while ( $row = mysql_fetch_array( $rs ) )
        {
        echo "<li><a href='" . $row['affurl'] . "'>" . $row['affname'] . "</a></li>";
        }
        ?>
        

          The Nuisance is bumping every few hours.

          Really, a JPEG of a blank image isn't a hell of a lot to go on. Have you looked at the generated page's source? Have you used mysql_error()? Have you set error_reporting to E_ALL?

            Well here is my opinion...when using a templating system i always had to do one thing. return( $whatever ); ... i'm sure these guys here can expand on that, but when ever i did a function or an if else deal i used return....

              Weedpacket wrote:

              The Nuisance is bumping every few hours.

              Really, a JPEG of a blank image isn't a hell of a lot to go on. Have you looked at the generated page's source? Have you used mysql_error()? Have you set error_reporting to E_ALL?

              sorry about the bumbing.. ill stop...

              the picture isnt blank look in top left side.

              no i haven't looked at source

              yes i always use mysql_error()

              and yes i have the errors turned on.

                Write a Reply...