how to pass url parameter via get

0

I'm having a question regarding passing parameters from one page to another. I've tried doing it in several ways via get. I can even get the parameter, but not all the parameters I can get. In the example below, I can only get the last id registered in the table ...

For example:

Through select, I am listing in menu form, in which I step the variable id of the database table. When I click on the link it redirects me to the page I have determined, however, it only takes the last id registered in the table, even if it has a different url, it does not take the id data for this ...

The code I'm using is as follows:

prepare('SELECT id, categoria FROM teste ORDER BY categoria ASC');
$stmt->execute(); 
if($stmt->rowCount() > 0) 
{ 
    while($row=$stmt->fetch(PDO::FETCH_ASSOC))
    { 
        extract($row); $Link = "".$row['categoria'].""; ?>
".$Link.""?>

The other page: "page"

prepare('SELECT * FROM teste WHERE id=" . $_GET["id"]');
if($stmt->rowCount() > 0)  
    while($row=$stmt->fetch(PDO::FETCH_ASSOC)){ // Escreve dados da pessoa } ?>

It's this way.

As I said at the beginning, I can only get and view the data of the last id registered in the table. Where is the error?

Can anyone help me with practical examples?

Note: I am working on the system with pdo. Ever since, I thank all of you for somehow helping me to resolve this issue. htaccess is configured like this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php

I've tried other settings in htaccess , but the problem persists.

    
asked by anonymous 28.05.2016 / 08:46

1 answer

0

Yes. I've decided to make changes.

To call the other page, I also put it:

<a href="#">#                                    
28.05.2016 / 23:12