Jump to content

Getting Data


williamh26

Recommended Posts

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>";
			 }
?>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.