I've been looking at this for over an hour, please look over and see if you see any errors.
mysql_query("INSERT INTO `pg_pages` (`user`,`name`,`keywords`,`description`,`title`,`body`) VALUES( `$foldername`, `$data[0]`, `$data[1]`, `$data[2]`, `$data[3]`, `$data[4]` )") or die(mysql_error());
here's the output I'm getting:
connected
Unknown column 'emaildomaincom' in 'field list'
the table setup up very simple
# CREATE statement for pg_pages
CREATE TABLE `pg_pages` (
`user` tinytext NOT NULL,
`name` tinytext NOT NULL,
`keywords` text,
`description` text NOT NULL,
`title` tinytext NOT NULL,
`body` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
and heres the "majority of the code"
foreach( $page as $key => $value){
/*echo "Name: $key, Age: $value <br />";*/
$data = explode("----",$value);
$menuname[$key] = $data[0];
$data[0] = str_replace(" ", "",$data[0]) ;
$data[0] = chop($data[0]) . $exttype;
$menulink[$key] = $data[0];
$menuitem .= "<li><a href='" . $menulink[$key] . "'>" . $menuname[$key] . "</a></li>";
$keywords[$key] = trim($data[1]);
$description[$key] = trim($data[2]);
$title[$key] = trim($data[3]);
// Set up the body text of the page
$data[4] = nl2br($data[4]);
$data[4] = str_replace("[LINK]","<a href = '", $data[4]);
$data[4] = str_replace('[URL="','', $data[4]);
$data[4] = str_replace("\"]","'>", $data[4]);
$data[4] = str_replace("[ENDLINK]","</a>", $data[4]);
$data[4] = str_replace("[BOLD]","<b>", $data[4]);
$data[4] = str_replace("[ENDBOLD]","</b>", $data[4]);
$data[4] = str_replace("[CENTER]","<center>", $data[4]);
$data[4] = str_replace("[ENDCENTER]","</center>", $data[4]);
$data[4] = str_replace("[ITALIC]","<i>", $data[4]);
$data[4] = str_replace("[ENDITALIC]","</i>", $data[4]);
$bdy = $body[$key] = addslashes($data[4]);
//echo "'$user'" . "'" . $data[0] . "'" . "'" . $data[1] . "'" . "'" . $data[2] . "'" . "'" . $data[3] . "'" . "'" . $data[4]."'";
//insert into database
/*$query = "INSERT INTO `pg_pages` (`user`,`name`,`keywords`,`description`,`title`,`body`) VALUES( `$foldername`, `$data[0]`, `$data[1]`, `$data[2]`, `$data[3]`, `$data[4]` ) ";
echo $query;*/
mysql_query("INSERT INTO `pg_pages` (`user`,`name`,`keywords`,`description`,`title`,`body`) VALUES( `$foldername`, `$data[0]`, `$data[1]`, `$data[2]`, `$data[3]`, `$data[4]` )") or die(mysql_error());
?>
<?
}
help please, also if you see other issues, please let me know