Jump to content

Abdi

New Members
  • Posts

    1
  • Joined

  • Last visited

Abdi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php session_start(); $per_page = 10; $query = mysql_query("SELECT * FROM 'bio'"); echo $pages = mysql_result($pages_query, 0); if ($_SESSION ['username']) echo "<right>Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Log out</a><br><a href='bio.php'>Post an Ad!</a></right>"; else die("You must be logged in!"); $connect = mysql_connect("localhost","root","4shizzle"); //connect to server mysql_select_db("textbooks"); //query the database $query = mysql_query("SELECT * FROM bio"); echo "<table border=1 cellpadding=10> <tr> <th>Date</th> <th>Class</th> <th>Book</th> <th>Price</th> <th>Email</th> </tr>"; while($rows = mysql_fetch_array($query)): $class = $rows['class']; $title = $rows['title']; $email = $rows['email']; $price = $rows['price']; $date = $rows['date']; $newDate = date("M-d", strtotime($date)); echo "<tr>"; echo "<td>" . $newDate . "</td>"; echo "<td>" . $class . "</td>"; echo "<td>" . $title . "</td>"; echo "<td>" . $price . "</td>"; echo "<td>". $email . "</td>"; echo "</tr>"; endwhile; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.