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

  • SEARCH
  • Home
  • 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 7569229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:06:59+00:00 2026-05-30T15:06:59+00:00

I have a little problem I can’t figure out how to solve. I have

  • 0

I have a little problem I can’t figure out how to solve.

I have an SQL result with 3 rows and I want to put the id from each row into a static marker ie.

MARKER_1 = 4
MARKER_2 = 5
MARKER_3 = 6

How can I do that so I get my static markers but with dynamic values?

I can’t do it with a normal

while($row = mysql_fetch_array($result)) {

} 
  • 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-30T15:07:00+00:00Added an answer on May 30, 2026 at 3:07 pm
    $i = 1;
    while($row = mysql_fetch_array($result)) {
        if($i == 1) {
            $marker_1 = $row;
        } elseif($i == 2) {
            $marker_2 = $row;
        } elseif($i == 3) {
            $marker_3 = $row;
        }
        $i++;
    } 
    

    i would recommend using an array like this

    $results = array();
    while($row = mysql_fetch_array($result)) {
        $results[] = $row;
    } 
    

    and then access it via:

    $results[0] // or $results[1] and so on. you can even loop that :)
    

    hope that helps

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

Sidebar

Related Questions

I have a little problem that I can't figure out how to solve. I
I have a little problem I can't solve so far. In BPEL I want
I have a little problem and i can not find how to solve it.
I have a little problem in VBA, I want to put row and column
I have a little problem and hope that you can help me. I want
I have a little problem and I'm hopping that you can help me solve
I have a little problem with autoconf, I know that you can use configure.ac
i have a little problem, i'm searching, but i can't found what i need,
I have little unusual problem to solve. I need some hint or links to
I have a little problem, I hope U can help me;) Trouble is, that

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.