So, you mean that after displaying "adasdasd" you want to display the image 1.gif, and after "adada" you want to display 2.gif, etc.?
Here's a pseudo-example of what you could do ...
PHP Code:
$sql = "SELECT * FROM Surah_Table ORDER BY Surah_ID"
$rs = mysql_query ($sql);
// Loop through the recordset
while ($row = mysql_fetch_array ($rs)) {
// Get the field data
$text = $row["Surah_Text"];
$imgs = $row["Surah_Arabic_Text"];
// Explode on newline to create arrays
$arrtext = explode ("\n", $text);
$arrimgs = explode ("\n", $imgs);
// Same number of elements in each array?
if (count ($arrtext) == count ($arrimgs)) {
echo "<p>";
// Loop through the arrays and display them
for ($i=0; $i<=count($arrtext)-1; $i++) {
echo $arrtext[$i] . " <img src=\"".$arrimgs[$i]."\"><br />";
}
echo "</p>";
}
}
Bookmarks