Printing Data:
\n";
while($row = mysql_fetch_assoc($ressource)) {
$commentary = $row['comment'].$row['comment_2'];
$emote = 0;
if(substr($commentary,0,2) === '::') {
$commentary = substr($commentary,2);
$emote = 1;
} elseif(substr($commentary,0,1) === ':') {
$commentary = substr($commentary,1);
$emote = 1;
} elseif(strtolower(substr($commentary,0,3)) === '/me') {
$commentary = substr($commentary,3);
$emote = 1;
} elseif(strtolower(substr($commentary,0,3)) === '/em') {
$commentary = substr($commentary,3);
$emote = 2;
} elseif(strtolower(substr($commentary,0,2)) === '/x') {
$commentary = substr($commentary,2);
$emote = 2;
} elseif(strtolower(substr($commentary,0,3)) === '/ms') {
$commentary = substr($commentary,3);
$emote = 3;
} elseif(strtolower(substr($commentary,0,2)) === '/p') {
$commentary = substr($commentary,2);
$emote = 4;
} else {
$commentary = $commentary;
}
echo $commentary."
\n";
mysql_query('UPDATE commentary SET comment = "'.mysql_real_escape_string(stripslashes($commentary)).'", emote = '.$emote.' WHERE commentid = '.$row['commentid'].' ');
$i++;
}
print $i.' rows updated';
?>