Basically, I’m trying to create a function in php that would give me the most recent column (message) that has no word greater than 40 characters. I was able to get the most recent message but I have no idea how to only get the most recent message that has no word greater than 40 characters. Please refer to the $callrecent variable.
<?php
function recentpost($postnum) {
$callrecent = "SELECT message FROM messages WHERE message (HAS NO WORD GREATER THAN 40 CHARACTERS) ORDER BY msg_id DESC LIMIT $postnum,1";
$callrecent_run = mysql_fetch_assoc(mysql_query($callrecent));
$message = stripslashes($callrecent_run['message']);
return $message;
}
?>
you could use regular expressions