.
words(). explode .
mysql, , -, .
, , retirn ( , ).
,
function dbgetvar($query){
$res = mysql_query($query);
if (!$res) {
trigger_error("dbget: ".mysql_error()." in ".$query);
return FALSE;
}
$row = mysql_fetch_row($res);
if (!$row) return NULL;
return $row[0];
}
,
$text = dbgetvar("SELECT text FROM table WHERE textID = 1");
$words = explode(" ",$text);
foreach ($words as $w) echo $w;