/** * Frees the results of the last query to clear up memory * */ public function free() { mysql_free_results($this->resource); }
<?php session_start(); if ($_SESSION['sid'] == session_id()) { $id = $_GET['id']; echo "welcome user"; echo "</br>"; echo "<a href='logout.php'>logout</a>"; include_once 'conn.php'; $se = "select * from user where id>1"; $q = mysql_query($se); echo "<table>\n"; echo "</br>"; echo "<tr><th>id</th><th>name</th><th>Username</th>\n<th>password</th><th>usertype</th></tr>"; while ($line = mysql_fetch_array($q, MYSQL_ASSOC)) { echo "\t<tr>\n"; foreach ($line as $col_value) { echo "\t\t<td>{$col_value}</td>\n"; } echo '<td>' . "<a href='edit.php?edit=" . $id . "'>Edit</a>" . '</td>'; echo "\t</tr>\n"; } echo "</table>\n"; mysql_free_results($q); mysql_close($con); }