Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

PermissionDenied

@PermissionDenied
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • display query result in a table using PHP
    P PermissionDenied

    here's my code... this is intended to display a query result in a table but i am getting unwanted characters and no table was displayed... what could be wrong with my codes? here it is... thanks in advance.. <html> <body> <?php if (isset($_POST['btnSearch'])) { //connection to the database $connection = mysql_connect('localhost', 'root', ''); if (!$connection) die(mysql_error()); //select database if (!mysql_select_db('bbs', $connection)) die(mysql_error); $SearchOpt = $_POST['SearchOption']; if (empty($SearchOpt)) die("You did not select field."); $SearchKey = $_POST['txtKey']; if (empty($SearchKey)) die("You did not enter a keyword."); $sqlQuery = mysql_query("SELECT * FROM t_board WHERE $SearchOpt LIKE '%$SearchKey%' ORDER BY registerTime DESC;"); if(!$sqlQuery) die(mysql_error()); if (mysql_num_rows($sqlQuery)) { echo "<tbody>"; $recs = mysql_fetch_array($sqlQuery) or die(mysql_error()); foreach($recs as $rec) { echo "<tr>"; echo "<th>" . $rec['index'] . "</th>"; echo "<th>".$rec['subject']."</th>"; echo "<th>".$rec['writer']."</th>"; echo "<th>".$rec['registerTime']."</th>"; echo "</tr>"; } echo "</tbody>"; } } ?> </body> </html>

    Linux, Apache, MySQL, PHP database php html mysql question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups