Det jeg tænke på at var at gemme føste by som a, næste som b, næste som c, etc. alstå 1,2,3.
Også på den side hvor de skal vise i omvendt række følge (...)
Du er genial. Jeg fik
det resultat jeg ledte efter.
Hvis andre skulle være interesseret:
viewLocation.php
<?php
// Require the database class
require_once('includes/DbConnector.php');
// Create an object (instance) of the DbConnector
$connector = new DbConnector();
// Execute the query to retrieve articles
$result = $connector->query('SELECT ID,country,city FROM cmscountry ORDER BY ID DESC LIMIT 1,1');
// Get an array containing the results.
// Loop for each item in that array
while ($row = $connector->fetchArray($result)){
echo ('<p>');
echo ('Last updated from ');
echo $row['city'];
echo (', ');
echo $row['country'];
echo ('</p>');
echo ('<p>');
include('nextCountry.php');
echo ('</p>');
}
?>
nextCountry.php
<?php
// Require the database class
require_once('includes/DbConnector.php');
// Create an object (instance) of the DbConnector
$connector = new DbConnector();
// Execute the query to retrieve articles
$result = $connector->query('SELECT ID,country,city FROM cmscountry ORDER BY ID DESC LIMIT 0,1');
// Get an array containing the results.
// Loop for each item in that array
while ($row = $connector->fetchArray($result)){
echo ('Headed for ');
echo $row['city'];
echo (', ');
echo $row['country'];
}
?>
Indlæg senest redigeret d. 30.03.2009 01:02 af Bruger #12579