 |
April 29, 2013, 10:45:33 PM |
|
Hi Guys,
I get below error. Please help me fix it.
query($show_tables); db_error(); while ($row = $result->fetch(PDO::FETCH_NUM)) { if ($row[0] == "configuration") $gotconfigtbl = 1; if ($row[0] == "hosts") $gothoststbl = 1; } if (!isset($gotconfigtbl)) include("configtbl.sql.php"); if (!isset($gothoststbl)) include("hoststbl.sql.php"); $config = get_config_data(); ?> Hosts Expand all Hosts query("SELECT * FROM hosts ORDER BY name ASC"); if ($result) { echo ""; echo create_host_header(); while ($host_data = $result->fetch(PDO::FETCH_ASSOC)) echo get_host_summary($host_data); echo create_totals(); echo " "; } else { echo "No Hosts found, you might like to add a host ? "; } ?> Add host
When I try to import configtbl.sql into my db i get
ERROR: Unknown Punctuation String @ 1 STR: <? SQL: <?
$tblstr = " CREATE TABLE IF NOT EXISTS `configuration` ( `yellowtemp` int(11) NOT NULL, `yellowrejects` int(11) NOT NULL, `yellowdiscards` int(11) NOT NULL, `yellowstales` int(11) NOT NULL, `yellowgetfails` int(11) NOT NULL, `yellowremfails` int(11) NOT NULL, `maxtemp` int(11) NOT NULL, `maxrejects` int(11) NOT NULL, `maxdiscards` int(11) NOT NULL, `maxstales` int(11) NOT NULL, `maxgetfails` int(11) NOT NULL, `maxremfails` int(11) NOT NULL, `email` varchar(200) NOT NULL, `yellowfan` int(11) NOT NULL, `maxfan` int(11) NOT NULL, `yellowgessper` int(11) NOT NULL, `maxgessper` int(11) NOT NULL, `yellowavgmhper` int(11) NOT NULL, `maxavgmhper` int(11) NOT NULL )".$table_props."; ";
SQL query:
<? $tblstr = " CREATE TABLE IF NOT EXISTS `configuration` ( `yellowtemp` int(11) NOT NULL, `yellowrejects` int(11) NOT NULL, `yellowdiscards` int(11) NOT NULL, `yellowstales` int(11) NOT NULL, `yellowgetfails` int(11) NOT NULL, `yellowremfails` int(11) NOT NULL, `maxtemp` int(11) NOT NULL, `maxrejects` int(11) NOT NULL, `maxdiscards` int(11) NOT NULL, `maxstales` int(11) NOT NULL, `maxgetfails` int(11) NOT NULL, `maxremfails` int(11) NOT NULL, `email` varchar(200) NOT NULL, `yellowfan` int(11) NOT NULL, `maxfan` int(11) NOT NULL, `yellowgessper` int(11) NOT NULL, `maxgessper` int(11) NOT NULL, `yellowavgmhper` int(11) NOT NULL, `maxavgmhper` int(11) NOT NULL )".$table_props."; ";
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?
$tblstr = " CREATE TABLE IF NOT EXISTS `configuration` ( `yellowtemp` int(' at line 1
|