$section_name = "Products";
include "../includes/leftnav.inc";
?>
include "../includes/products.inc";
?>
$ID = "";
$CATEGORY = "Wireless";
$db_name = "netway";
$table_name = "faqs";
$connection = @mysql_connect("localhost", "website", "web1234") or die("Could not connect to MySQL");
$db = @mysql_select_db($db_name, $connection) or die("Could not access the database");
if ($ID == "") {
if ($CATEGORY == "All") {
$sqlString = "SELECT * FROM $table_name ORDER BY category, question";
} else {
$sqlString = "SELECT * FROM $table_name WHERE category='" . $CATEGORY . "' ORDER BY id";
}
} else {
$sqlString = "SELECT * FROM $table_name WHERE id=" . $ID;
}
$result = @mysql_query($sqlString, $connection) or die("Could not execute query");
$temp_index = "none";
while ($row = mysql_fetch_array($result)) {
if ($temp_index != $row['category']) {
echo "" . mysql_unescape_string(strval($row['category'])) . " FAQs";
}
if ($row["question"] != "") {
echo "" . mysql_unescape_string(strval($row['question'])) . "";
}
if ($row["answer"] != "") {
echo "" . mysql_unescape_string(strval($row['answer'])) . " ";
}
$temp_index = $row['category'];
}
?>
require "../includes/ns_width_control.inc" ?>
|
|