It looks to me like you are trying to use a result your DB
query isn't set to generate.

You have
$sql= "select id from travel where id < '$id' and visible = 'checked' order
by id desc";

then

if ($row[article] != "") {

Your select only returned id, so the above if should always fail.

try
$sql= "select id,article from travel where id < '$id' and visible =
'checked' order by id desc";

and see if that works.
If not, let me know what kind of error you are getting.

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <    >
Sent: Friday, August 24, 2001 4:38 AM
Subject: [PHP] help needed


> PLEASE REPLY DIRECTLY TO THIS EMAIL ADDRESS, I AM NOT SUBSCRIBED TO THE
LIST
>
> hi there I am trying to insert this code into my pages to dynamically add
> backwards and forwards links to my pages but the code keeps giving me
> errors.
>
> below is the code, if someone could please tell me what I am doing wrong I
> would really apprectiate it.
>
> thanks
>
> steve
>
>
>
>
> <? //list previous if found using desc results array
>
>
> echo "<p align='center'>";
>
> $sql= "select id from travel where id < '$id' and visible = 'checked'
order
> by id desc";
> $result = mysql_query($sql) or die("Invalid Query");
> $row = mysql_fetch_array($result)
>
>
> if ($row[article] != "") {
> echo " &laquo; <a href='viewlog.php?id=";
> echo $row[id], "'>";
> echo Previous;
> echo "</a> &raquo;";
> echo "</font></font></p>\n";
> }
> else
> {
> echo <a href='travelog/"<FONT COLOR="#666699"><b><u>Home</u></b></a>
> }
>
> ?>
>
> echo " | "
>
> <? //list NEXT if possible using ascending results array
> $sql = "select id from travel where id > '$id' and visible = 'checked'
order
> by id asc";
> $result = mysql_query($sql) or die("Invalid Query");
> $row = mysql_fetch_array($result)
>
>
> if ($row[article] != "") {
> echo " &laquo; <a href='viewlog.php?id=";
> echo $row[id], "'>";
> echo Next;
> echo "</a> &raquo;";
> echo "</font></font></p>\n";
> }
> else
> {
> echo <a href='travelog/"<FONT COLOR="#666699"><b><u>Home</u></b></a>
> }
>
> ?>
>
> echo "</p>";
>
>
> *****************************************************
> CURRENTLY IN THAILAND
> Steven Raucher
> The Karma Tourer
> www.RaucherTour.com
> mailto:[EMAIL PROTECTED]
> yahoo messenger: stevenraucher
> *****************************************************


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to