GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Jul-2007, 13:55
Hyp3r grunt Hyp3r grunt is offline
New Member
 
Join Date: Jul 2007
Posts: 1
Hyp3r grunt is on a distinguished road

Permalinks, Help me with Permalinks


So I'm trying to get something to work. I have a mySQL database called 'news' with a table called 'news', I have a page called 'news.php' that is meant to display single entries depending on what is put in the address bar. This is the news.php page:

PHP Code:

<html>
<head>
<?php 
$id = (int)$_GET['id'];
$sql = "SELECT entry FROM news WHERE id='$id'";
 ?>
</head>
<body>
<p>The entry you have chosen will (hopefully, seeing as this is a test) be displayed below:
<p><?php echo $sql; ?>
</body>
</html> 


I can get it so it can take the number from the URL but I can't get it to display the entry I'm trying to display. What do I need to do to this page to make it so when you type 'http://www.mywebsite.com/news.php?id=1' into the address bar the entry with id number 1 will show up on the page? The details of my table are as follows: There are two columns in this table, they are called 'id' and 'entry'. The entry field is where the text I'm trying to get to display is. There is only one entry with an id of 1 and the entry contains the word 'john'.
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:39.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.