[ djovan01 @ 03.01.2007. 16:13 ] @
Htela bi da uradim search and display baziran na osnovu inputa. Znaci imam neki malo form gde korisnik ubaci id i prema tome treba da izbaci kompletan report. e ovako sam ja nesto napisala .Mislim da nisam postavila $result query kako treba. ne znam kako bi drugacije trebala da glasi. Hvala Ovo mi je formular: Code: <form action="viewreport.php" method="post"> <table width="300" border="1" align="center" class="styleForTable2"> <tr bgcolor="#993333"> <td colspan="2"><font color="#000000">Search </font></td> </tr> <tr> <td width="130">Quote Id</td> <td width="154"><input type="text" name="q_id"></td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"><input type="submit" name="Submit" value="Display Full Quote Request"></td> </tr> </table> <div align="center"></div> </form> ovo mi je viewreport.php Code: <?php $username = "lee_danijel"; $password = ""******; $hostname = "localhost"; $id = addslashes($_POST['q_id']); $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("leecontr_betaquote",$dbhandle) or die("Could not select quote"); $result = mysql_query("SELECT * FROM test WHERE 'q_id' = $q_id"); while ($row = mysql_fetch_array($result)) { echo "<table width='558' border='1' class='styleForTable'>\n"; echo"<tr><td width='558'>Contact Information</td></tr>\n <tr><td width='186'><strong>Company Name</strong><td width='186'><td>{$row['c_name']}</td></tr>\n <tr><td width='93'><strong>Primary Contact</strong></td><td width='93'>{$row['contact_name']}</td><td width='93'><strong>Phone</strong></td><td width='93'>{$row['phone']}</td><td width='93'><strong>E mail</strong></td><td width='93'>{$row['email']}</td></tr>\n <tr><td width='186'><strong>Job Location</strong></td><td width='186'>{$row['j_location']}</td></tr>\n <tr><td width='186'<strong>Approximate Start Date</strong></td><td width='186'>{$row['start_date']}</td></tr>\n <tr><td width='558'><strong>Facility Information</strong></td></tr>\n <tr><td width='186'><strong>Hours of Operation</strong><td width='186'>{$row['hours']}</td></tr>\n <tr><td width='93'><strong>Ceiling Height</strong></td><td width='93'>{$row['ceiling_ht']}</td><td width='93'><strong>Floor Thickness</strong></td><td width='93'>{$row['floor']}</td></tr>\n"; echo "</table>\n"; } ?> |