...

View Full Version : Error? I don't see it...



zelig
11-17-2011, 12:23 AM
Help. I can't figure out what is wrong. It states there is a unexpected t string error on line 22.

Thanks!



<?php
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
include("lib.php");
define("PAGENAME", "List Item");

if (isset($_POST['edit'])) {
$id = $_POST['id'];
$sql ="select from `items` where `id`='$id'";
mysql_query($sql) or die("MySQL error: ".mysql_error()."");
* * * * * * * * $query = $db->execute("select from `inventory` where `item_id`='$id'");

}
if (isset($_POST['clear'])) {
$sql ="delete from `items`";
mysql_query($sql) or die("MySQL error: ".mysql_error()."");
}

$bg = 1;
$spellquery = $db->execute("SELECT * FROM `items` ORDER BY `name`") or trigger_error("query failed: ".mysql_error());
while ($spellrow = $spellquery->fetchrow()) {
if ($bg == 1) { $page .= "<div style=\"width:98%; background-color:#eeeeee; font-family: tahoma; font-size: 8pt; line-height: 1.4em; color: #0A3549;\"><form method=\"post\"><p><input type=\"submit\" value=\"Edit\" name=\"edit\"> <input type=\"hidden\" name=\"id\" value=\"".$spellrow["id"]."\"> <b>".$spellrow["id"]."</b>: <b>".$spellrow["name"]."</b></p></form></div>\n"; $bg = 2; }
else { $page .= "<div style=\"width:98%; background-color:#ffffff; font-family: tahoma; font-size: 8pt; line-height: 1.4em; color: #0A3549;\"><form method=\"post\"><p><input type=\"submit\" value=\"Edit\" name=\"edit\"> <input type=\"hidden\" name=\"id\" value=\"".$spellrow["id"]."\"> <b>".$spellrow["id"]."</b>: <b>".$spellrow["name"]."</b></p></form></div>\n"; $bg = 1; }*
}

echo $page;
?>

Spookster
11-17-2011, 01:07 AM
Remove all the asterisks you have in there

Line 12
* * * * * * * * $query

Line 23
$bg = 1; }*



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum