Barand Posted November 2, 2012 Share Posted November 2, 2012 In the links for Genesis the id_libro values are 1. When you list the links for Exodus the id_libro in the link needs to be 2 and so on. You get the libro values from your database as you are creating the links. Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389772 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 exactly... but why it does not show.... do i hve to do another link? Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389773 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 (edited) This show that it picks the exact id from the database but it does not retrieve the text  http://www.youtube.com/watch?v=Pqqh5sUonQc Edited November 2, 2012 by williamh26 Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389776 Share on other sites More sharing options...
Barand Posted November 2, 2012 Share Posted November 2, 2012 Each chapter/capitulo has one link <a href=\"index.php?content=escritura&cat=$capitulo_id&libro_id=$libro_id\">Capitulo</a> Â When you list those for Genesis, the id_libro value in the links will be 1 Â When you list those for Exodus, the id_libro value in the links will be 2 Â and so on Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389779 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 actually not i was looking in a wrong part.. according with the database exodo starts a id_libro where link id =2 Â the id=2 starts in id number 1534... Â Â Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389780 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 i understant that and it supposed to be like that, however when i click exodus--> chapter 1 --> does not show the text.... Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389781 Share on other sites More sharing options...
Barand Posted November 2, 2012 Share Posted November 2, 2012 View the page source and check the values in the links Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389783 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 in the link perhaps shoud i put the id field like this: <a href=\"index.php?content=escritura&cat=$id=id&$capitulo_id&libro_id=$libro_id\"> Â and the code will get <?php $capitulo_id = intval ($_GET['cat']); $libro_id = intval ($_GET['libro_id']); $id = intval ($_GET['id']); $query="SELECT * from rv1960 where capitulo_id = $capitulo_id and libro_id= $libro_id and id=$id"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $id =$row['id']; $libro_id =$row['libro_id']; $versiculo =$row['versiculo']; $texto =$row['texto']; echo "<h3>$versiculo -- $texto</h3><br>"; echo"<p>"; } ?> Â But i dont know in the select query if it is rigth to put two "and" Â i try it.. and i got this result: Â Undefined variable: id in C:\wamp\www\Iglesia viviente\includes\capitulo.inc.php Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389786 Share on other sites More sharing options...
Barand Posted November 2, 2012 Share Posted November 2, 2012 If you put the id in the query you will limit the results to a single row. Â You want all the rows for libro/capitulo. Â Did you check the links in the page source? Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389787 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 (edited) yes it looks fine... maybe some modification in the sql query.? Â Source code: Â <?php $capitulo_id = intval ($_GET['cat']); $libro_id = intval ($_GET['libro_id']); $query="SELECT * from rv1960 where capitulo_id = $capitulo_id and libro_id= $libro_id"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $libro_id =$row['libro_id']; $versiculo =$row['versiculo']; $texto =$row['texto']; echo "<h3>$versiculo -- $texto</h3><br>"; echo"<p>"; } ?> Edited November 2, 2012 by williamh26 Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389790 Share on other sites More sharing options...
Barand Posted November 2, 2012 Share Posted November 2, 2012 What was the output from that ? Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389795 Share on other sites More sharing options...
williamh26 Posted November 2, 2012 Author Share Posted November 2, 2012 It shows only the chapters from Genesis and when I click Exodo nothing happens Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389799 Share on other sites More sharing options...
Barand Posted November 2, 2012 Share Posted November 2, 2012 I'm sure we've explained enough to you about how it should work, but we cannot debug it for you. That's down to you - we can't see the code or the output. Quote Link to comment https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.