I set up a form to send text to my database which would in turn make up my frontpage. When I set it up everything was fine, but now if I try to add any amount of text over three lines it doesn’t get added. I asked my host if anything had changed on the database and checked my settings (currently LONGTEXT) and nada. Obviously I have missed something. My main concern is delivering large amounts of text (2 or 3 paragraphs) from the form to the database. I know this code could be really streamlined, but I ended up with this as I broke everything down to see the parts working.
(There is code to find the lowest id and delete it, but that works alright)
$dbh = mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName");
$sqlquery = mysql_query("INSERT INTO $table(`na`, `body`, `homePage`, `face`, `day`) VALUES ('$na', '$body', '$homePage', '$face', NOW('0000-00-00'))");
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
if ($number > 1) {
print "<CENTER><P>Database error</CENTER>";
}
else{
echo "$na is the name<br>$face.gif is the the face chosen<br>";
echo "$homePage is the homepage<br>'$body'is the text of the message<br>";
echo "I hope you are proud of yourself<br>";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlqueryid = "SELECT * FROM $table order by id ASC LIMIT 1";
$resultid = mysql_query($sqlqueryid);
$numberid = mysql_numrows($resultid);
$lowid = mysql_result($resultid,$i,"id");
if ($numberid < 1) {
print "<CENTER><P>There Were No Results for Your Search</CENTER>";
}
else {
echo "id: $lowid<br>";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery3 = "DELETE FROM $table where id = $lowid";
$result2 = mysql_query($sqlquery3);
$number2 = mysql_numrows($result2);
}
}
mysql_close($dbh);
?>
I appreciate any help
Peter
ninjalicker