Quote:
Originally Posted by gilgalbiblewhee
I don't understand why the sql isn;t working in the for loop:
$booktitlesarray[] = "<span class='goToBookChapter' style='font-weight: bold;'>".$row['book_title']." ".$row['chapter'].":".$row['verse']."</span><br />".$row['text_data']."<br />";
|
Hi,
you've not specified an index for $booktitlesarray,
Declare a variable and initialise it as "0", like so : $bookcount = 0;
Then use this as the index of the array and increment it; $booktitlesarray[$bookcount++] = "<span... etc.
Like so;
if($result){
$bookcount = 0;
while($row = mysql_fetch_assoc($result)){
$booktitlesarray[$bookcount++] = "<span class='goToBookChapter' style='font-weight: bold;'>".$row['book_title']." ".$row['chapter'].":".$row['verse']."</span><br />".$row['text_data']."<br />";
}
}