SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    India
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem while creating a Table inside a Table

    Why is this file showing Blank page only:

    PHP Code:
    <?php
             
    include('db_connect.php');

    ?>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>

    <head>

    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META content="Art News" name=description>
    <META content="Art News" name=keywords>


    <title>Pictures</title>

    <STYLE type="text/css">
    <!--
    A:link { text-decoration:none }
    A:visited {text-decoration: none}
    A.set1:link {color: #FFFFFF; }
    A.set1:visited {color: #FFFFFF; }
    A:hover {text-decoration: underline}
    -->
    </STYLE>

    <SCRIPT>
    function OpenWindow(url)
    {
      previewWin = window.open(url, "Win", "scrollbars=yes,resizable=yes,status=yes");
    }
    </SCRIPT>

    </head>

    <body>

    <?php
        
    include('header.php');
    ?>

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr bgcolor="#CCCCCC">
        <td width="82%" height="17" bgcolor="#665599"></td>
        <td width="18%" height="17" bgcolor="#665599">&nbsp;</td>
      </tr>
    </table>

    <table width="100%" border="0" cellpadding="10" cellspacing="10">
    <tr>
          <td width="40%">
           <font face="Verdana" color="0000FF"><strong>Pictures</strong></font>
          </td>
          <td width="60%">
           <font face="Verdana" color="0000FF">Interested in putting up your work? &nbsp;
                 <a href="http://www.jalsaghar.com/addimage.php">Click here</a>
           </font>
          </tr>
    </table>


    <?php

        $just_image 
    1;
        if(
    $id)
        {
            
    $just_image 0;
            
    $sql=$db_object->query("Select * from image where id=$id");

            
    //execute the query
            //$result = mysql_query($sql,$connection);

            
    $row $sql->fetchRow(); // Make $row an array with the information

            
    $Artist=$row["artist"];
            
    $ImageURL=$row["url_image"];
            
    $Title=$row["title"];
            
    $Email=$row["email"];
            
    $Category=$row["category"];
            
    $Medium=$row["medium"];
            
    $Style=$row["style"];
            
    $Year_of_creation=$row["year_of_creation"];
            
    $Description=$row["description"];

            
    $sql_website $db_object->query("SELECT website FROM user WHERE email = '$Email'");
            
    $row_website $sql_website->fetchRow();
            
    $Website=$row_website["website"];


            echo(
    "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

             echo(
    "<tr>");

                echo(
    "<td width=\"70%\"  valign=\"top\">");
                    echo(
    " <img src=\"$ImageURL\"  alt=\"by $Artist\" border=\"0\"> ");

                echo(
    "</td>");

                echo(
    "<td width=\"30%\"  valign=\"top\">");


                        echo(
    "<b>Title: &nbsp</b>");echo("$Title"); echo("<br>");
                        echo(
    "<b>Artist: &nbsp</b>");echo("$Artist"); echo("<br>");
                        echo(
    "<b>Category: &nbsp</b>");echo("$Category"); echo("<br>");
                        if(
    $Medium)
                        {
                            echo(
    "<b>Medium: &nbsp</b>");
                            echo(
    "<a href=\"http://www.jalsaghar.com/image.php?medium=$Medium\">$Medium</a>");
                            echo(
    "<br>");
                        }
                        if(
    $Style)
                        {
                            echo(
    "<b>Style: &nbsp</b>");
                            echo(
    "<a href=\"http://www.jalsaghar.com/image.php?style=$Style\">$Style</a>");
                            echo(
    "<br>");
                        }
                        if(
    $Year_of_creation)
                        {
                            echo(
    "<b>Year: &nbsp</b>");echo("$Year_of_creation"); echo("<br>");
                        }
                        if(
    $Website)
                        {
                            echo(
    " <a href=javascript:OpenWindow(\"$Website\") title=\"pop up in a new window\">Website</a> ");
                            echo(
    "<br>");

                        }
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php\">More Images</a>");

                echo(
    "</td>");

               echo(
    "</tr>");

            echo(
    "</table>");

        } 
    // END of IF( $id)

        
    if($category)
        {
            
    $just_image 0;
            
    $sql=$db_object->query("Select * from image where category='$category'");

                if (
    DB::isError($sql))
                {
                            die(
    $sql->getMessage());
                }
                
    //execute the query
                //$result = mysql_query($sql,$connection);

                
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                          echo(
    "<tr>");

                            echo(
    "<td>");

                         
    //write the data
                         
    while($row $sql->fetchRow())
                         {
                             
    $No=$row["id"];
                            
    $Artist=$row["artist"];
                            
    $Title=$row["title"];
                            echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                            echo(
    "<br>");
                         }
                            echo(
    "</td>");

                          echo(
    "</tr>");

             echo(
    "</table>");
        } 
    // END of IF( $category)

        
    if($medium)
            {
                
    $just_image 0;
                
    $sql=$db_object->query("Select * from image where medium='".$medium."'");

                    if (
    DB::isError($sql))
                    {
                                die(
    $sql->getMessage());
                    }
                    
    //execute the query
                    //$result = mysql_query($sql,$connection);

                    
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                              echo(
    "<tr>");


                                  echo(
    "<td width=\"20%\"  valign=\"top\">");


                                 
    $sql_category=$db_object->query("Select distinct style from image");

                                 while(
    $row_category $sql_category->fetchRow())
                                 {
                                    
    $Style=$row_category["style"];
                                    echo(
    "<a href=\"http://www.jalsaghar.com/image.php?category=$Style\">$Style</a>");
                                    echo(
    "<br>");
                                 }

                                  echo(
    "</td>");

                                echo(
    "<td width=\"80%\"  valign=\"top\">");

                             
    //write the data
                             
    while($row $sql->fetchRow())
                             {
                                 
    $No=$row["id"];
                                
    $Artist=$row["artist"];
                                
    $Title=$row["title"];
                                echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                                echo(
    "<br>");
                             }
                                echo(
    "</td>");

                              echo(
    "</tr>");

                 echo(
    "</table>");
        } 
    // END of IF( $medium)

        
    if($style)
                {
                    
    $just_image 0;
                    
    $sql=$db_object->query("Select * from image where style='$style'");

                        if (
    DB::isError($sql))
                        {
                                    die(
    $sql->getMessage());
                        }
                        
    //execute the query
                        //$result = mysql_query($sql,$connection);

                        
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                                  echo(
    "<tr>");

                                    echo(
    "<td>");

                                 
    //write the data
                                 
    while($row $sql->fetchRow())
                                 {
                                     
    $No=$row["id"];
                                    
    $Artist=$row["artist"];
                                    
    $Title=$row["title"];
                                    echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                                    echo(
    "<br>");
                                 }
                                    echo(
    "</td>");

                                  echo(
    "</tr>");

                     echo(
    "</table>");
        } 
    // END of IF( $style)

        
    if($just_image)
        {



            
    //execute the query
            //$result = mysql_query($sql,$connection);

            
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

             echo(
    "<tr>");

              echo(
    "<td width=\"20%\"  valign=\"top\">");


                     
    $sql_category=$db_object->query("Select distinct category from image");

                     echo(
    "<b>Category</b>");echo("<br>");
                     while(
    $row_category $sql_category->fetchRow())
                     {
                        
    $Category=$row_category["category"];
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php?category=$Category\">$Category</a>");
                        echo(
    "<br>");
                     }
                    echo(
    "<br>");

                     
    $sql_medium=$db_object->query("Select distinct medium from image");

                     echo(
    "<b>Medium</b>");echo("<br>");
                     while(
    $row_medium $sql_medium->fetchRow())
                     {
                        
    $Medium=$row_medium["medium"];
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php?medium=$Medium\">$Medium</a>");
                        echo(
    "<br>");
                     }
                    echo(
    "<br>");

                     
    $sql_style=$db_object->query("Select distinct style from image");

                     echo(
    "<b>Style</b>");echo("<br>");
                     while(
    $row_style $sql_style->fetchRow())
                     {
                        
    $Style=$row_style["style"];
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php?style=$Style\">$Style</a>");
                        echo(
    "<br>");
                     }

              echo(
    "</td>");

              echo(
    "<td width=\"80%\"  valign=\"top\">");

                
    $sql=$db_object->query("Select * from image order by id desc");

                
    $Count=0;

                        echo(
    "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                         echo(
    "<tr>");
                             
    //write the data
                             
    while($Count <= $row $sql->fetchRow())
                             {
                                 ++
    $Count;

                                 echo(
    "<td width=\"33%\"  valign=\"top\">");

                                     
    $No=$row["id"];
                                    
    $Artist=$row["artist"];
                                    
    $Title=$row["title"];
                                    
    $Url_image=$row["url_image"];
                                    echo(
    "<img src=\"resize.php?imgname=$Url_image&imgsize=150\">");
                                    echo(
    "<br>");
                                    echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                                    echo(
    "<br>");

                                echo(
    "</td>");

                             }

                           echo(
    "</tr>");
                         echo(
    "</table>");

                echo(
    "</td>");

              echo(
    "</tr>");

             echo(
    "</table>");

        }


    ?>


    <?php
        
    include('footer.php');
    ?>

    </body>

    </html>
    I have modified in if($just_image) in the original file i.e the below one ....

    PHP Code:
    <?php
             
    include('db_connect.php');

    ?>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>

    <head>

    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META content="Art News" name=description>
    <META content="Art News" name=keywords>


    <title>Pictures</title>

    <STYLE type="text/css">
    <!--
    A:link { text-decoration:none }
    A:visited {text-decoration: none}
    A.set1:link {color: #FFFFFF; }
    A.set1:visited {color: #FFFFFF; }
    A:hover {text-decoration: underline}
    -->
    </STYLE>

    <SCRIPT>
    function OpenWindow(url)
    {
      previewWin = window.open(url, "Win", "scrollbars=yes,resizable=yes,status=yes");
    }
    </SCRIPT>

    </head>

    <body>

    <?php
        
    include('header.php');
    ?>

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr bgcolor="#CCCCCC">
        <td width="82%" height="17" bgcolor="#665599"></td>
        <td width="18%" height="17" bgcolor="#665599">&nbsp;</td>
      </tr>
    </table>

    <table width="100%" border="0" cellpadding="10" cellspacing="10">
    <tr>
          <td width="40%">
           <font face="Verdana" color="0000FF"><strong>Pictures</strong></font>
          </td>
          <td width="60%">
           <font face="Verdana" color="0000FF">Interested in putting up your work? &nbsp;
                 <a href="http://www.jalsaghar.com/addimage.php">Click here</a>
           </font>
          </tr>
    </table>


    <?php

        $just_image 
    1;
        if(
    $id)
        {
            
    $just_image 0;
            
    $sql=$db_object->query("Select * from image where id=$id");

            
    //execute the query
            //$result = mysql_query($sql,$connection);

            
    $row $sql->fetchRow(); // Make $row an array with the information

            
    $Artist=$row["artist"];
            
    $ImageURL=$row["url_image"];
            
    $Title=$row["title"];
            
    $Email=$row["email"];
            
    $Category=$row["category"];
            
    $Medium=$row["medium"];
            
    $Style=$row["style"];
            
    $Year_of_creation=$row["year_of_creation"];
            
    $Description=$row["description"];

            
    $sql_website $db_object->query("SELECT website FROM user WHERE email = '$Email'");
            
    $row_website $sql_website->fetchRow();
            
    $Website=$row_website["website"];


            echo(
    "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

             echo(
    "<tr>");

                echo(
    "<td width=\"70%\"  valign=\"top\">");
                    echo(
    " <img src=\"$ImageURL\"  alt=\"by $Artist\" border=\"0\"> ");

                echo(
    "</td>");

                echo(
    "<td width=\"30%\"  valign=\"top\">");


                        echo(
    "<b>Title: &nbsp</b>");echo("$Title"); echo("<br>");
                        echo(
    "<b>Artist: &nbsp</b>");echo("$Artist"); echo("<br>");
                        echo(
    "<b>Category: &nbsp</b>");echo("$Category"); echo("<br>");
                        if(
    $Medium)
                        {
                            echo(
    "<b>Medium: &nbsp</b>");
                            echo(
    "<a href=\"http://www.jalsaghar.com/image.php?medium=$Medium\">$Medium</a>");
                            echo(
    "<br>");
                        }
                        if(
    $Style)
                        {
                            echo(
    "<b>Style: &nbsp</b>");
                            echo(
    "<a href=\"http://www.jalsaghar.com/image.php?style=$Style\">$Style</a>");
                            echo(
    "<br>");
                        }
                        if(
    $Year_of_creation)
                        {
                            echo(
    "<b>Year: &nbsp</b>");echo("$Year_of_creation"); echo("<br>");
                        }
                        if(
    $Website)
                        {
                            echo(
    " <a href=javascript:OpenWindow(\"$Website\") title=\"pop up in a new window\">Website</a> ");
                            echo(
    "<br>");

                        }
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php\">More Images</a>");

                echo(
    "</td>");

               echo(
    "</tr>");

            echo(
    "</table>");

        } 
    // END of IF( $id)

        
    if($category)
        {
            
    $just_image 0;
            
    $sql=$db_object->query("Select * from image where category='$category'");

                if (
    DB::isError($sql))
                {
                            die(
    $sql->getMessage());
                }
                
    //execute the query
                //$result = mysql_query($sql,$connection);

                
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                          echo(
    "<tr>");

                            echo(
    "<td>");

                         
    //write the data
                         
    while($row $sql->fetchRow())
                         {
                             
    $No=$row["id"];
                            
    $Artist=$row["artist"];
                            
    $Title=$row["title"];
                            echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                            echo(
    "<br>");
                         }
                            echo(
    "</td>");

                          echo(
    "</tr>");

             echo(
    "</table>");
        } 
    // END of IF( $category)

        
    if($medium)
            {
                
    $just_image 0;
                
    $sql=$db_object->query("Select * from image where medium='".$medium."'");

                    if (
    DB::isError($sql))
                    {
                                die(
    $sql->getMessage());
                    }
                    
    //execute the query
                    //$result = mysql_query($sql,$connection);

                    
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                              echo(
    "<tr>");


                                  echo(
    "<td width=\"20%\"  valign=\"top\">");


                                 
    $sql_category=$db_object->query("Select distinct style from image");

                                 while(
    $row_category $sql_category->fetchRow())
                                 {
                                    
    $Style=$row_category["style"];
                                    echo(
    "<a href=\"http://www.jalsaghar.com/image.php?category=$Style\">$Style</a>");
                                    echo(
    "<br>");
                                 }

                                  echo(
    "</td>");

                                echo(
    "<td width=\"80%\"  valign=\"top\">");

                             
    //write the data
                             
    while($row $sql->fetchRow())
                             {
                                 
    $No=$row["id"];
                                
    $Artist=$row["artist"];
                                
    $Title=$row["title"];
                                echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                                echo(
    "<br>");
                             }
                                echo(
    "</td>");

                              echo(
    "</tr>");

                 echo(
    "</table>");
        } 
    // END of IF( $medium)

        
    if($style)
                {
                    
    $just_image 0;
                    
    $sql=$db_object->query("Select * from image where style='$style'");

                        if (
    DB::isError($sql))
                        {
                                    die(
    $sql->getMessage());
                        }
                        
    //execute the query
                        //$result = mysql_query($sql,$connection);

                        
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

                                  echo(
    "<tr>");

                                    echo(
    "<td>");

                                 
    //write the data
                                 
    while($row $sql->fetchRow())
                                 {
                                     
    $No=$row["id"];
                                    
    $Artist=$row["artist"];
                                    
    $Title=$row["title"];
                                    echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                                    echo(
    "<br>");
                                 }
                                    echo(
    "</td>");

                                  echo(
    "</tr>");

                     echo(
    "</table>");
        } 
    // END of IF( $style)

        
    if($just_image)
        {



            
    //execute the query
            //$result = mysql_query($sql,$connection);

            
    echo("<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");

             echo(
    "<tr>");

              echo(
    "<td width=\"20%\"  valign=\"top\">");


                     
    $sql_category=$db_object->query("Select distinct category from image");

                     echo(
    "<b>Category</b>");echo("<br>");
                     while(
    $row_category $sql_category->fetchRow())
                     {
                        
    $Category=$row_category["category"];
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php?category=$Category\">$Category</a>");
                        echo(
    "<br>");
                     }
                    echo(
    "<br>");

                     
    $sql_medium=$db_object->query("Select distinct medium from image");

                     echo(
    "<b>Medium</b>");echo("<br>");
                     while(
    $row_medium $sql_medium->fetchRow())
                     {
                        
    $Medium=$row_medium["medium"];
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php?medium=$Medium\">$Medium</a>");
                        echo(
    "<br>");
                     }
                    echo(
    "<br>");

                     
    $sql_style=$db_object->query("Select distinct style from image");

                     echo(
    "<b>Style</b>");echo("<br>");
                     while(
    $row_style $sql_style->fetchRow())
                     {
                        
    $Style=$row_style["style"];
                        echo(
    "<a href=\"http://www.jalsaghar.com/image.php?style=$Style\">$Style</a>");
                        echo(
    "<br>");
                     }

              echo(
    "</td>");

              echo(
    "<td width=\"80%\"  valign=\"top\">");

                
    $sql=$db_object->query("Select * from image order by id desc");

             
    //write the data
             
    while($row $sql->fetchRow())
             {
                 
    $No=$row["id"];
                
    $Artist=$row["artist"];
                
    $Title=$row["title"];
                
    $Url_image=$row["url_image"];
                echo(
    "<img src=\"resize.php?imgname=$Url_image&imgsize=150\">");
                echo(
    "<br>");
                echo(
    "<a href=\"http://www.jalsaghar.com/image.php?id=$No\">$Title by $Artist</a>");
                echo(
    "<br>");
                echo(
    "<br>");
             }
                echo(
    "</td>");

              echo(
    "</tr>");

             echo(
    "</table>");

        }


    ?>


    <?php
        
    include('footer.php');
    ?>

    </body>

    </html>

  2. #2
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i go to www.scriptlance.com when i cant get answers in a forum. try this there

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    India
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But I am sure I will get help here like I used to get earlier .....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •