...

View Full Version : Hyperlink database output and open new page



kleidi
02-27-2010, 04:55 PM
Hello everyone!

I'm looking around on how to link an output field of a database and when a user clicks on it, to open a new page with all the database container. What i have just now is the output code only:


<?php
include 'D:/Program Files/VertrigoServ/www/live/admini/includet/variabla.php';
include (BPATH . '/includet/dbconfig.php');
include (BPATH . '/includet/dblidhja.php');
$query="SELECT * FROM `ndeshje` ORDER BY `ndeshje`.`ora`";
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
?>
<br /><br /><center><div class="ndeshjeshfaq">
<table width="598" border="0" align="center" class="ndeshjekoka">
<tr>
<td width="50" class="ndshfaqora">Ora</td>
<td width="90" class="ndshfaqdata">Data</td>
<td width="315" class="ndshfaqndeshja">Emri</td>
</tr>
</table></center>


<?php
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$ndeshja=mysql_result($result,$i,"ndeshja");
$ora=mysql_result($result,$i,"ora");
$data=mysql_result($result,$i,"data");
?>
<center>
<table width="598" border="0">
<tr>
<td width="50" class="ndshfaqora"><?php echo $ora; ?></td>
<td width="90" class="ndshfaqdata"><?php echo $data; ?></td>
<td width="315" class="ndshfaqndeshja"><a href="index.php?id=<?php echo $id; ?>"><?php echo $ndeshja; ?></a></td>
</tr>
</table></center>

</div>
<?php
$i++;
}
?>

The output looks like :


18:25 01.03.2010 Transformers 2 - Premiere
where Transformers 2 - Premiere is linked /index.php?id=$id

...
Until there is ok, but now, i don't know how to continue. I need that, when i click on that link, to load a new page with all database output of that id (in our example case, when i click on "Transformers 2 - Premiere" i need a page where should load the date, the time of movie, the date of movie and the trial of that movie.)

....

Hope that i have explained good what i need and i was understandable.

Waiting for your help!

Thank you in advance!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum