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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:25:22+00:00 2026-05-25T13:25:22+00:00

I passed id from 1 page to another- <?php $sql = SELECT * FROM

  • 0

I passed id from 1 page to another-

        <?php
         $sql = "SELECT * FROM page";
        $result = mysql_query("SELECT * FROM page",$connection);

        $id=0;


 while($re=mysql_fetch_array($result))
      { $id++;

        echo"<a href=\"test.php?id={$id}\">{$re["name"]}'</a>'";

        }?>

and used this on the reciever page-

    <?php


$ide=$_GET['id'];

 $result1 = mysql_query("SELECT * FROM page where name='ide'",$connection);

 while($re1=mysql_fetch_array($result1))
  {  
    echo $re1["name"];

    }

it works sine on the sending side ..BUT the problem is it’s not displaying anything on the reciever side..i tested that it’s not even going inside the while loop.
please help?

  • 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-25T13:25:23+00:00Added an answer on May 25, 2026 at 1:25 pm

    This will go horribly wrong as soon as you start deleting records in the database as the $id variable in the first script is not related to a specific database entry at all.

    If the ID you are passing around is stored in the database field name, it should be something like:

    Edit: changed name to id for the ID:

    <?php
       $sql = "SELECT * FROM page";
       $result = mysql_query("SELECT * FROM page",$connection);
    
       while($re=mysql_fetch_array($result))
       {
          echo"<a href=\"test.php?id={$re["id"]}\">{$re["name"]}'</a>'";
       }
    ?>
    

    and:

    <?php
    
      $ide = (int) $_GET['id'];    // sql injection...
    
      $result1 = mysql_query("SELECT * FROM page where id='{$ide}'",$connection);
    
      while($re1=mysql_fetch_array($result1))
      {  
        echo $re1["name"];
      }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to receive a data which is passed using intent from another page.Can
I am passing the id value from one page media_main.php to another player.php via:
I am trying to take a variable passed from another page and use it
I'm new to ASP.net, how can I read parameters passed from ASP.net page (
I need to try and spoof the HTTP_REFERER passed my another page so that
I have a page bottom1.php it has 16 select menus, labled rating1-rating16. When the
showDescriptionPath is being passed from the previous Tableview. The text shows up, but the
I have a NSString which is passed from an xml feed........ NSString *strDate =@May
Is it possible to view the mapping configurations / mapping xml files passed from
I am calling a jsp based on 2 parameters which is passed from jsp

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.