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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:53:31+00:00 2026-06-11T01:53:31+00:00

i have this code which is not seeming to work, what i want to

  • 0

i have this code which is not seeming to work, what i want to do is make a query to understand users’ level, and then based on that level i need to print different content, for the moment it prints the default one, and i get this error message:

mysql_result() expects parameter 1 to be resource, boolean given on this line:

$rank = mysql_result($rank1, 0, 'rank');

the code is like this:

session_start();
if(!$_SESSION['username']){

header("location:login.php"); // Redirect to login.php page
}
else //Continue to current page
header( 'Content-Type: text/html; charset=utf-8' );
$rank1 = mysql_query("SELET access FROM tbl_galleries WHERE column='username" . mysql_real_escape_string($_SESSION['username']) . "'");
$rank = mysql_result($rank1, 0, 'rank');

switch ($rank)
{
case 3:
  echo "<div><a href='#'>Order DIAMOND Membership</a></div>";
  break;

case 2:
  echo "<div><a href='#'>Order PLATINUM Membership</a></div>
    <div><a href='#'>Order DIAMOND Membership</a></div>";
  break;

case 1:
  echo "<div><a href='#'>Order ELITE Membership</a></div>
    <div><a href='#'>Order PLATINUM Membership</a></div>
    <div><a href='#'>Order DIAMOND Membership</a></div>";
  break;

default:
  echo "<div><a href='#'>Order PRO Membership</a></div>
    <div><a href='#'>Order ELITE Membership</a></div>
    <div><a href='#'>Order PLATINUM Membership</a></div>
    <div><a href='#'>Order DIAMOND Membership</a></div>";
}
  • 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-06-11T01:53:32+00:00Added an answer on June 11, 2026 at 1:53 am

    For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning
    resultset, mysql_query() returns a resource on success, or FALSE on
    error.

    For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc,
    mysql_query() returns TRUE on success or FALSE on error.

    This means you have some error in your query. Try to finalize the query in phpMyAdmin or some other such tool. Your query should go something like this

    $userName = mysql_real_escape_string($_SESSION['username']);
    $sql = "SELECT access 
            FROM tbl_galleries 
            WHERE username = $userName";
    $result = mysql_query($sql);
    $rank = mysql_result($result, 0, 'access');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in my cfm, which works <cfif not StructIsEmpty(form)> <cfset larray
I have this code which adds a x number of views to a Multiview
I have this code which does the trick: #include <stdio.h> int main() { int
I have this code which is called at an onChange event of an function
I have this code which gets WP posts, but it gets all the posts
I have this code (which is way simplified from the real code): public interface
I have this code which compiles and works as expected: class Right {}; class
I have this code which will include template.php file from inside each of these
I have this code which should create a splash image with either no animation
I have this code which is passed to Paypal checkout: <?php foreach ($paypalBasket as

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.