Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:17:50+00:00 2026-05-28T15:17:50+00:00

I have written the following while loop in a php file. The file does

  • 0

I have written the following while loop in a php file. The file does exactly what I want it to do. However, my code editing program (Netbeans IDE 7.0.1) keeps indicating the following error: “missing ) after argument list”. The error is attached to the line inside the javascript tags. Is there a problem in how I’m creating the var Topcaption? The code seems to work fine in IE, FF and Chrome. Thanks for any advice you can offer!

    if ($totalRows_Top_Slides != 0) {
    mysql_data_seek($Top_Slides,0);
    $i = 1;
    $j = 100;
    while ($row = mysql_fetch_array($Top_Slides)) {             
        ?>
            <script type="text/javascript">
                var Topcaption<?php echo $i;?>  = "<?php echo $row['caption'];?>";
            </script>
        <?php
        $Top_images .= "<img id=\"Topimage" . $i . "\" class=\"slide_out\" style=\"z-index: " . $j . "\" src=\"" . $row['file_folder'] . $row['file'] . "\" width=\"280\" height=\"170\" alt=\"\" />";
        $i = $i + 1;
        $j = $j - 1;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:17:51+00:00Added an answer on May 28, 2026 at 3:17 pm

    I’ve pasted your sample code into my version of NetBeans on Ubuntu and it simply appears to be a bug in NetBeans 7.0.1. To fix, upgrade to Netbeans 7.1.

    As a side-note, for sanity’s sake, I recommend changing your code to:

    <?php
    mysql_data_seek($Top_Slides,0);
    $i = 1;
    $j = 100;
    echo '<script type="text/javascript">';
    while ($row = mysql_fetch_array($Top_Slides)) {             
     echo 'var Topcaption'.$i.' = "'.$row['caption'].'";';
     $Top_images .= "<img id=\"Topimage" . $i . "\" class=\"slide_out\" style=\"z-index: " . $j . "\" src=\"" . $row['file_folder'] . $row['file'] . "\" width=\"280\" height=\"170\" alt=\"\" />";
     $i = $i + 1;
     $j = $j - 1;
    }
    echo '</script>';
    ?>
    

    That way, you will only have 1 script tag, rather than 100.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a following code to get just the file name without extension
I have written the following code choice /m Do you want to add another
I have written the following simple C code, which compiles and runs fine. However
I have written the following code. But it is removing only &nbsp; not <br>
i have written the following code: As you can see there is a for
I have written the following IronPython code: import clr clr.AddReference(System.Drawing) from System import *
I have the following program that writes a user's input to a file. Currently
I have written the following piece of code ( sql clr stored procedure )
I have written the following line of code that reads the data in a
I have a daemon written in PHP. I use the following command to call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.