Jump to content

search and view in php and mysql


babyphp

Recommended Posts

i have created a php form and 5 database table

i can use the form which has various sections to input data from the form into the 3 table

 

 

what i want now is have a search page that i can type a search word into and it shows me the records of what i have got from the database

 

eg

 

name,last name is in table1

address, postcode in tabel2

businesstype, equipment in table3

 

 

i want to type in say john as a firstname it give me all the john details from table1-3 but in a short form then when i click view tab i can see more detail about john in a page

Link to comment
https://forums.phpfreaks.com/topic/101048-search-and-view-in-php-and-mysql/
Share on other sites

how do i do that

do you have any ideal how i can do this i tried this code

<?php

$username  = "webuser";

$password = "";

$database = "collinsdemo";

$server = "intranet";

 

 

$db_handle = mysql_connect($server, $username, $password);

$db_found = mysql_select_db($database, $db_handle);

 

 

 

$result = mysql_query("SELECT * FROM contacts");

 

echo "<table border='1'>

<tr>

<th>Firstname</th>

<th>Lastname</th>

</tr>";while($row = mysql_fetch_array($result))

  {

  echo "<tr>";

  echo "<td>" . $row['firstName'] . "</td>";

  echo "<td>" . $row['lastName'] . "</td>";

  echo "</tr>";

  }

 

?>

 

but it doesnt show me no data

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.