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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:28:13+00:00 2026-06-08T17:28:13+00:00

Node1id is the user that sent the request and node2id is the user that

  • 0

Node1id is the user that sent the request and node2id is the user that is receiving the request. How would I limit the code below to only display the request to node2id. I tried doing:

$row->relationType == 'requested' && node2id == $userid

but it doesn’t seem to want to work. Any ideas?

enter image description here

<?php
$selectedId = $_REQUEST['id'];
$myuserid = $this->session->userdata('userid');
$query1 = $this->db->query("SELECT * FROM friends WHERE node1id = '{$myuserid}' AND node2id = '${selectedId}'");
      foreach($query1->result() as $row) {
      if ($row->relationType == 'requested') { ?>
            <script type="text/javascript">
                $(document).ready(function() {
                    $("#addFriend").replaceWith('<span id="requestAlert"><span class="font1">wants to be your friend&nbsp;</span><input type="submit" id="acceptRequest" value="Accept" style="width: 60px; height: 28px" class="button1" />&nbsp;<input type="submit" id="denyRequest" value="Deny" style="width: 50px; height: 28px" class="button1" /></span>');
                });
            </script>
<?php } } ?>
  • 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-08T17:28:14+00:00Added an answer on June 8, 2026 at 5:28 pm

    Edit: Based on your comment. Here’s what I think it should look like from your description:

    <?php
      $selectedId = $_REQUEST['id'];
      $myuserid = $this->session->userdata('userid');
      $query1 = $this->db->query("SELECT * FROM friends WHERE relationType = 'requested' AND node2id = '${myuserid}' AND node1id ='$selectedId'");
      foreach($query1->result() as $row) { ?>
           <script type="text/javascript">
              $(document).ready(function() {
                 $("#addFriend").replaceWith('<span id="requestAlert"><span class="font1">wants to be your friend&nbsp;</span><input type="submit" id="acceptRequest" value="Accept" style="width: 60px; height: 28px" class="button1" />&nbsp;<input type="submit" id="denyRequest" value="Deny" style="width: 50px; height: 28px" class="button1" /></span>');
              });
           </script>
      <?php }  ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Code Logic: 1) User types in username and password, user clicks submit. 2) jQuery
I have a database that has node & nodetype tables. Nodes table NodeID ParentNodeID
I have a class as below: public class Node { public int NodeID {
I have two tables, one that contains nodes and second that contains the relationships
I have two tables that represent parent/child nodes, their types, and their relationships: Table
I have a FOR XML PATH Stored Procedure that returns some XML in the
I would like to know if there is a way to move the node
I am populating a JSTree view with ajax commands. My current JS code is
I am not talking about $(#demo1).jstree(rename,node) which makes the node editable for the user.
I have clustered applications that requires one of the nodes to be designated 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.