babyphp Posted April 14, 2008 Share Posted April 14, 2008 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 Quote Link to comment Share on other sites More sharing options...
poleposters Posted April 14, 2008 Share Posted April 14, 2008 You need two scripts. One to search and display a short selection of details about John Smith and another to retrive more detailed information. Quote Link to comment Share on other sites More sharing options...
babyphp Posted April 15, 2008 Author Share Posted April 15, 2008 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 Quote Link to comment Share on other sites More sharing options...
twsowerby Posted April 15, 2008 Share Posted April 15, 2008 try adding: $query = mysql_query($result); below the $result variable. Regards, Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.