Results 1 to 3 of 3

Thread: Else error :S

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Else error :S

    Big problem, the code below is returning an error (unexpected else)

    I do not know what i have done wrong?

    This is the page i am getting the error on :S

    PHP Code:
    <?php
        $db 
    mysql_connect("***""***""***");
        
        
    mysql_select_db("***",$db);
        
        
    $result mysql_query("SELECT * FROM meltdown_download Where category='programs'",$db);
        

        
        while (
    $myrow mysql_fetch_row($result)) {
        

            
    $imgQuery mysql_query("SELECT * FROM meltdown_images Where download_id='" $myrow[0] . "' LIMIT 1",$db);

            
    $num_rows mysql_num_rows($imgQuery);

                 if (!
    $num_rows==0);
                
                    echo 
    $imgQuery[1];
                
                else 
                
                    echo(
    "<table class=\"content_main\" cellspacing=\"0\" cellpadding=\"0\" >\n");
                    echo(
    "  <tr>\n");
                    echo(
    "    <td class=\"content_tl\"></td>\n");
                    echo(
    "    <td class=\"content_t\">" $myrow[2] . "</td>\n");
                    echo(
    "    <td class=\"content_tr\"></td>\n");
                    echo(
    "  </tr>\n");
                    echo(
    "   <tr>\n");
                    echo(
    "    <td class=\"content_stl\"></td>\n");
                    echo(
    "    <td class=\"content_stm\"></td>\n");
                    echo(
    "    <td class=\"content_str\"></td>\n");
                    echo(
    "  </tr>\n");
                    echo(
    "  <tr bgcolor=\"#FFFFFF\">\n");
                    echo(
    "    <td class=\"content_l\"></td>\n");
                    echo(
    "    <td class=\"content_m\">" $myrow[3] . "</td>\n");
                    echo(
    "    <td class=\"content_r\"></td>\n");
                    echo(
    "  </tr>\n");
                    echo(
    "  <tr>\n");
                    echo(
    "    <td class=\"content_sbl\"></td>\n");
                    echo(
    "    <td class=\"content_sbm\"></td>\n");
                    echo(
    "    <td class=\"content_sbr\"></td>\n");
                    echo(
    "  </tr>\n");
                    echo(
    "  <tr>\n");
                    echo(
    "    <td class=\"content_bl\"></td>\n");
                    echo(
    "    <td class=\"content_b\"></td>\n");
                    echo(
    "    <td class=\"content_br\"></td>\n");
                    echo(
    "  </tr>\n");
                    echo(
    "</table>\n");
                    echo(
    "<br>\n");
                
            
        }
        
    ?>

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Else error :S

    I am going to do you a favour ....
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Else error :S

    First, take a look at this: http://www.vbforums.com/showpost.php...49&postcount=7

    Now your code should be looking something like:
    PHP Code:
    <?php
        $db 
    mysql_connect("***""***""***");
        
        
    mysql_select_db("***",$db);
        
        
    $result mysql_query("SELECT * FROM meltdown_download Where category='programs'",$db);
          
        while (
    $myrow mysql_fetch_row($result)):   
            
    $imgQuery mysql_query("SELECT * FROM meltdown_images Where download_id='" $myrow[0] . "' LIMIT 1",$db);
            
    $num_rows mysql_num_rows($imgQuery);

            if (!
    $num_rows==0):
                
    /* to echo the first row */
                
    echo (mysql_result($imgQuery0));
            else: 
    // remember PHP is embedded inside HTML
    ?>
        <table class="content_main" cellspacing="0" cellpadding="0" >
            <tr>
                <td class="content_tl"></td>
                <td class="content_t"><?php echo($myrow[2]) ?></td>
                <td class="content_tr"></td>
            </tr>
            <tr>
                <td class="content_stl"></td>
                <td class="content_stm"></td>
                <td class="content_str"></td>
            </tr>
            <tr bgcolor="#FFFFFF">
                <td class="content_l"></td>
                <td class="content_m"><?php echo($myrow[3]) ?></td>
                <td class="content_r"></td>
            </tr>
            <tr>
                <td class="content_sbl"></td>
                <td class="content_sbm"></td>
                <td class="content_sbr"></td>
            </tr>
            <tr>
                <td class="content_bl"></td>
                <td class="content_b"></td>\
                <td class="content_br"></td>
            </tr>
        </table> <br />
    <?php
            
    endif;
        endwhile;
    ?>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width