Okay, so I've literally spent all day trying to achieve this and have gotten nowhere. I am creating a flipbook (using turn.js). I have names and cause of death stored in a MySQL database. I want to print 5 names and their cause of death on each page. To add a page in turn.js, all i have to do is add a in
So i load the name and cause of death values into arrays, and then echo a whole div however with the array variable.
I'm really having trouble getting this into code. At the moment I have managed to get this onto seperate pages, but how would i get it to print only 5 on a page, and then create a new page (untill there are no more names)
Here is what i have so far.
<?php
$dbc = mysql_connect('localhost', 'xxxx', 'xxxxxxx');
if (!$dbc) {
die('Not Connected: ' . mysql_error());
}
$db_selected = mysql_select_db("xxxxxx", $dbc);
if (!$db_selected)
{
die ("Can't Connect : " . mysql_error);
}
$query = "SELECT * FROM TABLE";
$result = mysql_query($query);
$victim = array();
$cod = array();
$count = 0;
while ($row = mysql_fetch_assoc($result)) {
$victim['$count'] = $row['Victim'];
$cod['$count'] = $row['COD'];
$count++;
}
?>
<div id="deathnote">
<div style="background-image:url(images/coverpage.jpg);"></div>
<div style="background-image:url(images/page1.jpg);"></div>
<div style="background-image:url(images/page2.jpg);"></div>
<div style="background-image:url(images/page3.jpg);"></div>
<div style="background-image:url(images/page4.jpg);"></div>
<div style="background-image:url(images/page5.jpg);"></div>
<?php
for ($x=0; $x=$count; $x++) {
echo "<div style='background-image:url(images/page5.jpg);'></div><div class='content'><div class='name'>" . $victim['$x'] . "</div><div class='cod'>" . $cod['$x'] . "</div></div></div>";
}
?>
Any help will be GREATLY appreciated. Thanks in advance, guys :)