Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389772
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389779
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389786
Share on other sites

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 by williamh26
Link to comment
https://forums.phpfreaks.com/topic/269884-getting-data/page/2/#findComment-1389790
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.