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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:34:08+00:00 2026-06-15T11:34:08+00:00

I’m working on a little system for SecondLife which involves a bit of heavy

  • 0

I’m working on a little system for SecondLife which involves a bit of heavy use of databases & I’ve run into a problem I can’t for the life of me solve.

I’m trying to run a query that selects an entire row based on two different column values. I’m using the $_GET[”] call to identify which details I need, and then I need to pull all the data from the entire row and echo it onto a blank page.

Now, I got it to work at first, but it was pulling ALL the rows created by a UUID and echoing them, when I only needed a specific. Then I tried to get it to work with a second identifier (which is a column called ‘field’ for the purpose of testing), and that’s pretty much where I lost it.

I just need to select one row that has two exact values, and I need it to be draconian so it only selects a row that has both and not just one of the two.

Any ideas?

Script enclosed (don’t mind the mess or the commented out code which I kept for reference; I am going to clean the script once I get it working!)

     <?php

// Get key from the parameter.
$avatar_key = $_GET['key'];

// Quest params.
$questname = $_GET['questname'];
$questid = $_GET['id'];


// Connect to the database. $con holds connection info.

$con = mysql_connect("localhost","user","pass");

// Error checking.
if(!$con)
{
    die('Could not connect: '.mysql_error());
}


// Select the DB we want.
mysql_select_db("yyyyy_slcom",$con);

// Build the query.
$query = "SELECT * FROM sldb_data WHERE sldb_data.uuid = '$avatar_key' AND sldb_data.field = '$questname'";
/*$query = "select * from (
                            select uuid, field, value, progress, ROW_NUMBER() OVER (PARTITION BY uuid ORDER BY progress DESC)
            ";*/

// Run the query, store the result in variable $result.
$result = mysql_query($query);

if(!result)
{
die('Error: ' . mysql_error());
}

// Check how many rows we got back with our query.
$rows_returned = mysql_num_rows($result);

echo $row['field'];

// If we get anything back,
if($rows_returned > 0)
{




    //echo $row['field'] . ' was found.' . $questname;
    /*if(!$row['field'])
    {
        echo 'You are not on this quest yet.';
    }
    elseif(($row['field']) && ($row['value'] == "notstarted"))
    {
        echo 'This quest hasn\'t started yet.';
    }
    elseif(($row['field']) && ($row['value'] == "started"))
    {
        echo 'You are on quest: "' .$row['field']. '"';
    }*/

    /* $fields = mysql_list_fields("tenaar_slcom","sldb_data");
    $columns = mysql_num_fields($fields);
    for ($i = 0; $i < $columns; $i++) {$field_array[] = mysql_field_name($fields, $i);}

    if(in_array($quest, $field_array))
    {
        echo 'Your quest is ' . $row['field'];
    }
    elseif(!in_array($questname, $field_array))
    {
        echo 'You are not on this quest yet.';
    }
    elseif((in_array($questname, $field_array)) && ($row['value'] == "notstarted"))
    {
        echo 'You have not started quest "' .$row['field']. '" yet.';
    } */    

    // cycle through and print what we got.
    //while($row = mysql_fetch_array($result))
    //{

        //echo 'Quest name: ' . $row['field'] . ' | Progress: ' .$row['value'] . '<br />';

    //}
}
/*else
{
echo 'You are not on this quest yet.';
}*/

// Close the connection.
mysql_close($con);

?>
  • 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-15T11:34:09+00:00Added an answer on June 15, 2026 at 11:34 am

    You appear to be missing a step in-between the time you get the number of rows and when you print out the field. You need to actually store the results of the query in the $row array.

    $rows_returned = mysql_num_rows($result);
    $row = mysql_fetch_array($result);
    echo $row['field'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
I am currently running into a problem where an element is coming back from
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.