Ok, I originally posted in the mysql forum but I have now narrowed down the problem to PHP (or at least my PHP coding).
I'm trying to update TEXT and LONGTEXT fields in mysql via a PHP script. Updates to other fields work fine, but these fields update for a while and then just stop updating with MySQL returning error 0.
I know it's not MySQL because I had a colleague write a java prog to do the same thing and that works fine.
Can anybody help me here? Any known problems or is it just my code (see below).
-- Nick Gushlow
----------oOo----------
session_start();
include ($DOCUMENT_ROOT.'/core/database.php');
db_connect();
db_select();
$result = mysql_query("SELECT * FROM test
WHERE id = '2'
");
$row = mysql_fetch_array($result);
if ($submit) {
$newlog1 = $row[log1].$log1;
$newlog2 = $row[log2].$log2;
$insert = mysql_query("UPDATE test
SET log1 = '$newlog1', log2 = '$newlog2'
WHERE id = '$row[id]'
");
if (!$insert) {
echo "ERROR!";
echo $newlog1;
echo "<p>";
echo $newlog2;
} else {
echo "Successful <BR>";
echo $newlog1;
echo "<p>";
echo $newlog2;
}
}
?>
<head>
<title>Test Page for MySQL Updates via PHP</title>
</head>
<body>
<p>This is a test page, and edits a test table in the dws-support database. </p>
<form name="form1" method="post" action="<?php echo $PHP_SELF;?>">
<p><b>Call ID: <?php echo $row[id];?></b></p>
<p><b>Add to Log.</b></p>
<p>log1:
<textarea name="log1"></textarea>
</p>
<p>log2:
<textarea name="log2"></textarea>
</p>
<INPUT type="submit" name="submit" value="Submit">
<p> </p>
<p><b>Current Info.</b></p>
<p>log 1: <?php echo $row[log1];?></p>
<p>log 2: <?php echo $row[log2];?></p>
</form>
<p> </p>
</body>