Hey everyone,
Im trying to use tinymce in a cms (homemade- php) to edit a pages content, However i can only seem to post 2 or 3 lines of content to the database, if i try and post anymore than this then it just doesnt update at all.
I know this isnt the best way to make a cms but its my first attempt
Anybody got any ideas
Cheers
Problems Posting Content
Moderator: General Moderators
Re: Problems Posting Content
Any errors? Code example?
Are you escaping your string before you post them? Is the field size i your database too small?
Are you escaping your string before you post them? Is the field size i your database too small?
Re: Problems Posting Content
hey no errors, goes to success message.
the database is set to a longtext, tried multiple settings set with the limitcharacters
Form Code
Process Code
Above is the code minus tinymce - as it isnt working without it either
the database is set to a longtext, tried multiple settings set with the limitcharacters
Form Code
Code: Select all
<?php
//import the database connection file
include("connect.php");
// Send the preloaded content to the function.
$request ='faqs';
$query = mysql_query( "SELECT * FROM contents WHERE page = '".$request."'");
//fetch the results of the $query and store them in $row
$row = mysql_fetch_array($query);
?>
<form name="update" action="updatefaq.php" method="post">
<p> </p>
<textarea name="elm1"><?php echo $row['content'];?></textarea>
</script>
<input name="submit" type="submit" value="Submit" />
</form>
Code: Select all
<?php
//import the database connection file
include("connect.php");
//The UPDATE query used ... this is used to CHANGE an existing record to the users table
$request ='faqs';
mysql_query("UPDATE contents SET content = '".$_POST['elm1']."' WHERE page =
'$request'");
echo "Thank you! Information updated.";
mysql_close($dbconnection);
?>
Re: Problems Posting Content
You should check for query errors using mysql_error()
Re: Problems Posting Content
im not sure i put the error function in right but i put
and it came up with
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 'nonexistentdb' 1146: Table 'kossu.nonexistenttable' doesn't exist Se' at line 1
Which really doesnt mean much to me!
Code: Select all
<?php
//import the database connection file
include("connect.php");
//The UPDATE query used ... this is used to CHANGE an existing record to the users table
$request ='faqs';
$sql= mysql_query("UPDATE contents SET content = '".$_POST['elm1']."' WHERE page =
'$request'");
if (!$sql)
{
die(mysql_error());
}
echo "Thank you! Information updated.";
mysql_close($dbconnection);
?>
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 'nonexistentdb' 1146: Table 'kossu.nonexistenttable' doesn't exist Se' at line 1
Which really doesnt mean much to me!