A little array problem
Posted: Sat Aug 17, 2002 11:31 am
In a bit of my code, I take out everything in a the title column from my DB and stick it into an array....but i was to have it so that after it displays 32 characters in and title it puts "..."
So obviously there is something wrong there, and I'm horrible with array...can anyone help? Thanks!
later on, -Brian
Code: Select all
$listquery = "select title, num, time, user from poems where type='o' order by num $sortdir";
$listresult = mysql_query($listquery); // Connects to another table without a count
while ($row = mysql_fetch_assoc($listresult)) {
$titlesї] = $rowї"title"]; //get the title of each poem in a loop
if(strlen($titlesї]) > 35)
{
$titlesї] = substr($titlesї], 0, 32)."...";
}
} //end of whilelater on, -Brian