Re: help needed
| From: | Sheridan Saint-Michel | Date: | Fri, 24 Aug 2001 14:11:13 +0000 |
| Subject: | Re: help needed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64247@lists.php.net to get a copy of this message | ||
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: <steven@raucher.com>
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 " « <a href='viewlog.php?id=";
> echo $row[id], "'>";
> echo Previous;
> echo "</a> »";
> 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 " « <a href='viewlog.php?id=";
> echo $row[id], "'>";
> echo Next;
> echo "</a> »";
> 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:steven@raucher.com
> yahoo messenger: stevenraucher
> *****************************************************