Page with index.php?id=1
jeef06
Posted messages
259
Status
Membre
-
Mihawk Posted messages 4753 Status Contributeur -
Mihawk Posted messages 4753 Status Contributeur -
Hello,
I would like to know how to create pages like: index.php?id=1
with ID calls from the SQL database?
This would be to separate news on different pages.
News 1 would be on the page: index.php?id=1
News 2 would be on the page: index.php?id=2
News 3 would be on the page: index.php?id=3
...
Thanks in advance
Configuration: Windows 7 / Firefox 7.0.1
I would like to know how to create pages like: index.php?id=1
with ID calls from the SQL database?
This would be to separate news on different pages.
News 1 would be on the page: index.php?id=1
News 2 would be on the page: index.php?id=2
News 3 would be on the page: index.php?id=3
...
Thanks in advance
Configuration: Windows 7 / Firefox 7.0.1
2 réponses
It should be something like:
<?php
if(!isset($_GET['id']))
{
include('default_page.php');
}
else
{
$Request = "SELECT * FROM news WHERE id = '".$_GET['id']."'";
// Process Request and display the result
// Check if the result is not empty: if(empty($Result))
}
?>
--
When there’s a will, there’s a way! Or maybe not...
<?php
if(!isset($_GET['id']))
{
include('default_page.php');
}
else
{
$Request = "SELECT * FROM news WHERE id = '".$_GET['id']."'";
// Process Request and display the result
// Check if the result is not empty: if(empty($Result))
}
?>
--
When there’s a will, there’s a way! Or maybe not...