djdellux Posted November 19, 2008 Share Posted November 19, 2008 hello forum i am new to coding and i have wrote this code as my first but i need the output to be in a table... any suggestions thanks in advance <html> <head> <title>Loggin DB</title> </head> <body> <h1 align=left>Please enter search feilds</h1> <body bgcolor="#82CAFA"> <form method="get" action="loggin1.php"> Page: <select name="Page"> <option value="approve.php" >Approve</option> <option value="custquery" >CustQuery</option> <option value="slpnlogin">SlpnLogin</option> </select> User Code: <select name="UserCode"> <option >T3</option> <option >J9</option> <option>BL</option> <option >SC</option> <option >MN</option> <option >CA</option> <option>MW</option> <option >TJ</option> <option >E2</option> </select> Date: <input type="text" name="Date"> <p><input name="submitted" type="submit" value="send"/></p></form> <?php $db = $_SERVER['DOCUMENT_ROOT']."/../data/log.db"; //connect to sql $handle = sqlite_open($db); $query = "SELECT * FROM log where id > 85076"; if(isset($_GET['submitted']) && $_GET["submitted"] == "send") { if ($_GET["Page"] !="") { $query.=" and page='" .$_GET["Page"]."'"; } if ($_GET["UserCode"] !="") { $query.=" and userCode=\"" .$_GET["UserCode"]."\""; } if(isset($_GET["time"])) { $query.=" and time='" .$_GET["Time"].""; } } echo $query; $result = sqlite_query($handle, $query); $row = sqlite_fetch_array( $result ); echo "<table style='border-style: solid; border-width:1px;border-color:red;'>"; while($row = sqlite_fetch_array($result)){ echo " <tr>\n"; echo " <td> $row[id]</td><td> $row </td> <td> $row[desc] </td><td> $row[userCode] </td><td> $row[codeType] </td><td>". date( "Y-m-d", $row['time'])."</td><td> $row[ipaddr]</td>\n"; echo " </tr>\n"; } echo "</table>"; ?> </html> Quote Link to comment Share on other sites More sharing options...
djdellux Posted November 19, 2008 Author Share Posted November 19, 2008 this is it I did it myself thx ppl lol echo "<style type='text/css'> table { border-width: 1px; border-spacing:0px ; border-style: double; border-color: black; border-collapse: separate; background-color: #82CAFA; } table th { border-width: 1px; padding: 0px; border-style: solid; border-color: black; background-color: #82CAFA; } table td { border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #82CAFA; } </style> <table class='db'; cellspacing=\"0px\"> "; 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.