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 6743605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:58:52+00:00 2026-05-26T11:58:52+00:00

I have the following code: $result = mysql_query(select * from ${db_name}_users limit 1); while

  • 0

I have the following code:

$result = mysql_query("select * from ${db_name}_users limit 1");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) 
{
    if ($player[$ships_killed] == 1) 
        echo "1";
    else if ($player[$ships_killed] == 2) 
        echo "2";
    else if ($player[$ships_killed] == 3) 
        echo "3";
    else if ($player[$ships_killed] == 4) 
        echo "4";
    else if ($player[$ships_killed] == 5) 
        echo "5";
    else if ($player[$ships_killed] =< 10) 
        echo "10";
    else if ($player[$ships_killed] =< 15) 
        echo "15";
    else if ($player[$ships_killed] =< 20) 
        echo "20";
    else 
        echo "Over Range";    
}   

I’m having a hard time with the less than or equal signs, it doesnt show the proper value. For example, when the field shows “11” it instead echos “Over Range”.

My problem is that specific field grows a lot and I cannot cover every single value with an equals case.

The numbered values will eventually be replaced with an image such as echo "<img src='img/badges/1i.png' />"; therefore I don’t want to echo the value directly.

Is there a workaround this?

  • 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-26T11:58:53+00:00Added an answer on May 26, 2026 at 11:58 am

    First issue is the =< sign, which is wrong. Try using <= instead.

    Also, instead of using nested if’s, you could use a switch statement, maybe with a counter.

    switch ($player[$ships_killed])
    {
        case "1": echo "1";
        ...
    }
    

    Teslo.

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

Sidebar

Related Questions

I have the following code: (query added) $weight_table = mysql_query (SELECT * FROM .$prefix.weight
I have the following code: $sql = mysql_query(SELECT id FROM logins WHERE id=' .
.i have the following code: $task_id = mysql_query(SELECT MAX(task_id) from it_task); echo $task_id; .what
I have the following (simplified) result from SELECT * FROM table ORDER BY tick,refid
I have the following PHP/MySQL code: function executeMultirowQuery($query) { $result = mysql_query($query); $table =
I have the following code in action script 3: async.addResponder(new Responder(result, defaultFaultHandler)); result is
I have the following code : std::string Utils::get() { std::string result; result.append(1, 'x'); result.append(1,
I have the following code: public static T ParameterFetchValue<T>(string parameterKey) { Parameter result =
Inside my template function I have the following code: TypeName myFunction() { TypeName result;
I have a select query that currently produces the following results: Description Code Price

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.