Gossamer Forum
Home : General : Internet Technologies :

PHP problem

Quote Reply
PHP problem
I'm trying to get it so that when a verse exists after the one being shown, it gives a link to view it and when the verse does not exist, it displays "end" or "start". I thought that I could do this by making a mysql query and seeing if it returned with a value. Somehow, it's not working. In the database, the field doesn't exist yet it's still returning as a value.



Code:


$previous_sql = @mysql_query("SELECT bible_text FROM ptv3_bible_ot WHERE bible_book = '$book' AND bible_chap = '$jump_chap' AND bible_verse = '$verse_minus'");

if(!$previous_sql) {
echo("<span class='smtextblk'>start</span>");
} else {
echo("<a href='" . $PHP_SELF . "?bible_action=" . $bible_action . "&view=" . $view . "&book=" . $book . "&jump_chap=" . $jump_chap . "&jump_verse=" . $verse_minus . "' class='bible_link'>previous</a>");
}


Can anyone see anything wrong with this?
Subject Author Views Date
Thread PHP problem JoFrRi 5738 Jan 7, 2004, 3:59 PM
Post Re: [JoFrRi] PHP problem
Andy 5533 Jan 8, 2004, 1:38 AM
Thread Re: [JoFrRi] PHP problem
greykher 5533 Jan 9, 2004, 10:42 PM
Post Re: [greykher] PHP problem
JoFrRi 5512 Jan 10, 2004, 6:59 PM