...

View Full Version : Link to content



p@p
12-22-2010, 05:33 AM
Hello I have a problems with link the content, the content is stored into mysql database.

The field in database is id, headline and content.
I only can do listing the id and headline using fetch array, and my problems is how to linking that''s id and headline when user click that's link it's retrieving the details about the id:
For example:


<?php
// Make a MySQL Connection
require_once('db.php');
$query = "SELECT * FROM lirik WHERE id";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['id']. " - ". $row['title']. " - ". $row['dt'];
?>

That's the php script what i used for received id and headline.

My question is:

How to make a link when the user click the link it's a details about id, headline and content?


Thanks for people help me :)

syncupsolutions
12-22-2010, 07:56 AM
No offense, but I think there is a communication gap here because of your English. We'll try and help you, but I'm not exactly sure what you want.

Are you saying that you want a link that fetches information about a certain row in the database ? If so, there are a few more things you need.

One, either you must find a way to dynamically set a link for each row in the table.

Then, when the user clicks a specific link, have the id included in the URL, something like:

http://mypage.com/index.php?id=IDHere

Have a switch for ID setup to GET the value of ID, query the database for the content and the headline for that ID, and echo the values onto the page in whatever format you need.

p@p
12-22-2010, 08:04 AM
No offense, but I think there is a communication gap here because of your English. We'll try and help you, but I'm not exactly sure what you want.

Are you saying that you want a link that fetches information about a certain row in the database ? If so, there are a few more things you need.

One, either you must find a way to dynamically set a link for each row in the table.

Then, when the user clicks a specific link, have the id included in the URL, something like:

http://mypage.com/index.php?id=IDHere

Have a switch for ID setup to GET the value of ID, query the database for the content and the headline for that ID, and echo the values onto the page in whatever format you need.

Yes it is :( Sorry my english very bad i knew it :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum