thx, I'm begining to suspect that the problems is my AS - PHP to AS communication once the entries are fetched, but just in case here is my code:
<?
/*
-----
*/
$DBhost = "";
$DBuser = "";
$DBpass = "";
$DBName = "";
$table = "";
$numComments = 10;
$DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error in GuestBook Application: " . mysql_error());
mysql_select_db($DBName, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$action = $_GET['action'];
switch($action) {
case 'read' :
$sql = 'SELECT * FROM ' . $table . 'where titleID=$titleID;
$allComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$numallComments = mysql_num_rows($allComments);
$sql .= ' ORDER BY `time` DESC LIMIT ' . $_GET['NumLow'] . ', ' . $numComments;
$fewComments = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
$numfewComments = mysql_num_rows($fewComments);
print '&totalEntries=' . $numallComments . '&';
print "<br>&entries=";
if($numallComments == 0) {
print "No entries in the guestbook, as yet..";
} else {
while ($array = mysql_fetch_array($fewComments)) {
$name = mysql_result($fewComments, $i, 'name');
$email = mysql_result($fewComments, $i, 'email');
$comments = mysql_result($fewComments, $i, 'comments');
$time = mysql_result($fewComments, $i, 'time');
print '<b>Name: </b>' . $name . '<br><b>Comments: </b>' . $comments . '<br><i>Date: ' . $time . '</i><br><br>';
$i++;
}
}
if($_GET['NumLow'] > $numallComments) {
print 'No More Entries!&';
}
break;
case 'write' :
$titleID = ereg_replace("&", "%26", $_POST['videoID']);
$name = ereg_replace("&", "%26", $_POST['yourname']);
$email = ereg_replace("&", "%26", $_POST['youremail']);
$comments = ereg_replace("&", "%26", $_POST['yourcomments']);
$submit = $_POST['submit'];
$submitted_on = date ("Y-m-d H:i:s",time());
if($submit == 'Yes'){
$sql = 'INSERT INTO ' . $table .
' (`ID`,
`titleID`,
`name`,
`email`,
`comments`,
`time`
)
VALUES
(\'\','
. '\'' . $titleID . '\','
. '\'' . $name . '\','
. '\'' . $email . '\','
. '\'' . $comments . '\','
. '\'' . $submitted_on . '\'
)';
$insert = mysql_query($sql, $DBConn) or die("Error in GuestBook Application: " . mysql_error());
print "&gb_status=Thank you for posting a comment.&done=yes&";
return;
}
print "&_root.write.gb_status=Error!&";
break;
}
?>