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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:31:51+00:00 2026-06-15T20:31:51+00:00

I am generating web pages from database. Now my question is: I have 1000

  • 0

I am generating web pages from database. Now my question is:

I have 1000 records(names) in my database(MySql).
I have made a search box in a page and when i enter any name or a part of name that is in my DB all the name’s should come up.
Eg-

SELECT * FROM table where name like '%$find%'

Now i want to show the selected names(fetched through the query) on the new page so that when i click on any of the name a new page should open up and all the data related to that selected name (present in the table belonging to the database)to be shown on that page with navigation buttons, what query should i use to perform it.

In short i want to make my page like Google search page.

My first page is like this

<html>
<body >
<h2>Search</h2> 
<form name="search" method="post" action="second.php">
Search Name: <input type="text" name="find" id="find" /> 
<input type="submit" name="search" value="search" />
</form>
</body>
</html>

Second page is somewhat like this

  <html>
  <head>
  <script>
  function favBrowser()
  {
  var mylist=document.getElementById("opt");
  document.getElementById("favorite").value=mylist.options[mylist.selectedIndex].text;

   }
  </script>
  </head>

 <body>

  <form  method="get">

 <?php
 $find = $_REQUEST['find'];
 $con = mysql_connect("localhost","root","");
 if (!$con)
 {
 die('Could not connect: ' . mysql_error());
  }
 mysql_select_db("data", $con);


  $result = mysql_query("SELECT * FROM table where name like '%$find%'");


  $result_rows = mysql_num_rows($result);

 while($row = mysql_fetch_array($result))
{

 // $names[] = $row['name'];  
 // echo $names[0];

 // echo "$row[name]. $row[id] <a href='data.php?edit=$row[name]'>edit</a><br />";

 $_name = $row['name'];

 echo "Name : <input type='text' name='name' value='$_name' size='30'>";

 echo "<br />";
 }
 }
 mysql_close($con);

?>

<!--</select>
<input type ="submit" value="submit">
<p>Your selected name is: <input type="hidden" name="fun" id="favorite" size="30">
</p>
 -->

</body>
</html>
  • 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-15T20:31:52+00:00Added an answer on June 15, 2026 at 8:31 pm

    Well, simplified, on the first page you’ll have something like:

    while($row = mysql_fetch_array($result))
    {
       $_name = $row['name'];
       echo '<a href="second_page.php?name='.strip_tags($_name)'" target="_BLANK"'.'</a>';
    }
    

    and on the second page you have name, passed as URL parameter, on which you then do another database look up to get the contacts details and populate the various fields:

    $_name = $GET['name'];
    

    Please remember to add the required escapes or rather use PDO / mysqli

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

Sidebar

Related Questions

I am generating a table in HTML from a MySQL database, so that stored
We have a web application that is generating some 3-5 parallel threads every five
A lot of web frameworks have a standard setup for generating forms with auth
I have developed a web project. Which is generating log file using log4j. But
Okay, Now admittedly this sounds like a silly question; But, I actually have a
I have a static web pages protected by apache basic auth . It is
I need some help in generating dynamic web Title pages, based on what action
I have a 3-tier web application (database, app tier, web tier) written in MVC.
I'm generating a email from a web page and taking a section of the
We have built a .net (asp) web based solution (SQL Server database) for a

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.