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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.