Alright, this is the deal. All my queries work. They're fine.
The problem is that when I add the text into the database (pageContent in specific), it truncates at wierd places. I use htmlentities() to make sure all the possible characters that could mess up the query are stripped down as far as possible, then I use decode on the other end. The HTML parses out fine, and I don't get -any- database errors. My database class will automatically die and echo out a database error if one occurs when it runs a query.
pageContent and pageModuleContent are of the text datatype... which might be a problem. I can't use varchar because of the amount of data it needs to hold.
This is for a CMS by the way. For a school, none the less. I use an if-else to decide if it should add or update, but this is definitely a query issue (or else I missed something...).
//add
$q = $db->query( "INSERT INTO [pages] (
[pageParent],
[creationDate],
[pageName],
[pageContent],
[pageModuleContent],
[linkArray],
[order] ) VALUES (
'{$_POST['pageParent']}',
".time().",
'{$_POST['pageName']}',
'" . htmlentities( $_POST['pageContent'], ENT_QUOTES ) . "',
'" . htmlentities( $_POST['pageModuleContent'], ENT_QUOTES ) . "',
'" . implode( "[!*!]", array( $_POST['linkArray1'], $_POST['linkArray2'] ) ) . "',
'{$_POST['order']}' );" );
$msg = ( $q ? "Created {$_POST['pageName']}" : "Error" );
//update
$linkArray = array( $_POST['linkArray1'], $_POST['linkArray2'] );
$q = $db->query( "UPDATE [pages] SET
[pageParent]='{$_POST['pageParent']}',
[pageName]='{$_POST['pageName']}',
[pageContent]='" . htmlentities( $_POST['pageContent'], ENT_QUOTES ) . "',
[pageModuleContent]='" . htmlentities( $_POST['pageModuleContent'], ENT_QUOTES ) . "',
[linkArray]='" . implode( "[!*!]", array( $_POST['linkArray1'], $_POST['linkArray2'] ) ) . "',
[order]='{$_POST['order']}'
WHERE [pageId]='{$_POST['pageId']}'" );
$msg = ( $q ? "Updated {$_POST['pageName']}" : "Error" );
echo ( $msg );
Thanks...
edit: changed code tag to php.