All pastes #730074 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-10-08 21:09 UTC
rendered paste body
<?php
$con = mysql_connect("localhost","","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("myproducts", $con);





$result = mysql_query("SELECT * FROM articles WHERE MATCH(title,body) AGAINST= ('database')");


echo "<table border='1'>";

while($row = mysql_fetch_array( $result )) {
  echo "<tr>";
  echo "<td><img src='" . $row['Picture'] . "'></td>";
  echo "<td><table>";
  echo "<tr>";
  echo "<td><b><i>" . $row['Title'] . "</i></b></td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td>$" . $row['Price'] . "</td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td>" . $row['Description'] . "</td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td>" . $row['Buttons'] . "</td>";
  echo "</tr>";
  echo "</table></td>";
  echo "</tr>";
  }
echo "</table>";


mysql_close($con);
?>