permanent link

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

aia
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Feb 21, 2013 10:24 am

permanent link

Postby aia » Thu Feb 21, 2013 10:48 am

Hello forum,

I am newbie in php.So i will describe my problem.
I have created one very simple form for 'create-edit-delete' post in database.The posted data appeared all in index.php one below the other.I managed this with mysql function:

Code: Select all

mysql_fetch_array()

But all these data that appear in index.php don't have permanent link.
I tried to put in the title of each post link like that:

Code: Select all

<a href="index.php?id=1">My-Post-1</a>

but the result was to return the same page.I mean that returned again the initial index.php and not only the specific id allone.
I want each post to appear as individual in index.php
Could annyone help to understand how to make permanent link for each post?
And if it possible to appeared in the same index.php if it is not to appeared in the external page.

Thanks

---
aia

aia
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Feb 21, 2013 10:24 am

Re: permanent link

Postby aia » Thu Feb 21, 2013 2:16 pm

The solve:

Code: Select all

$result = mysql_query("SELECT * FROM post where id={$_GET['id']}");

while($row = mysql_fetch_array( $result )) {

      echo $row['article'];
}


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 5 guests