Results 1 to 10 of 10

Thread: if negative result in sql search how to express?

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    447

    if negative result in sql search how to express?

    If you run a sql search and the result is negative, meaning the word isn't found in the database what should I write.

    PHP Code:
    $sql "SELECT * FROM [I]TABLENAME[/I] WHERE this='".$this."' or this='".$that."' ";
    $result mysql_query($sql) OR exit( 'Error: ' mysql_error() );
    while(
    $row mysql_fetch_array($result)){} 
    How can I put an if/else statement?

    if it finds $this but doesn't find $that?
    Last edited by gilgalbiblewhee; Aug 1st, 2010 at 12:17 AM.
    Compare bible texts (and other tools):
    TheWheelofGod

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width