Hi All,
Have a bit of a strange problem..
I have written a small peice of code to write my web pages from an admin section of my website.
All seemed to be working very well, until I noticed pages randomly stop being able to be UPDATED via mysql
I looked into maybe the fact that my field was too small in my mysql database, so I changed it to LONGTEXT, but I still have the same problem.
The weird thing is if I add a new database entry then use this script to create the 'content' section of the new listing I can sometimes UPDATE the page with a 1000 lines of text, sometime only 100 lines, and then get the error message "Sorry there was an error, please try again"???
I thought maybe the database has a character or byte size limit, but if I create a new db lisitng I can once again enter data into it via the below script, until it randomly stops.
Any one got any ideas what this could be?
if ($submit) {
$currentidb = $_SESSION['idthree'] ;
$add1 = '<P class=normal>';
$add2 = '</P><br>';
if ($radio1) {
$add1 = '<P class=title2>';
$add2 = '</P>';
}
if ($radio2) {
$add1 = '<div class="center"><table class=main cellpadding="5" cellspacing="0"><tr><td>';
$add2 = '</td></tr></table></div><br>';
}
if ($users_file) {
echo "user file turned out true??";
$entercontent = $users_file_name ;
$add1 = "<P class=header><img src=/images/";
$add2 = "></P><br>";
} else {
$entercontent = nl2br("$entercontent");
}
$entercontentb = $add1.$entercontent.$add2;
$result = mysql_query("SELECT * FROM add1 WHERE id ='$currentidb'",$db);
$myrow = mysql_fetch_array($result);
$newvar = $myrow['content'].$entercontentb;
$sql = "UPDATE `add1` SET `content` = '$newvar', date = NOW() WHERE `id` = '$currentidb'";
$result = mysql_query($sql);
if (!$result) {
echo "<P class=header>Sorry there was an Error, Please try again</P>";
} else {
echo "<P class=header>thankyou information updated</P>";
}
$link2 = TRUE ;
}