SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2003
    Location
    ontario
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    !$result failure

    I have the following code:
    PHP Code:
    $result=mysql_query("SELECT * FROM dealercart WHERE dealerid='$dealerid'");
    if (!
    $result){
    echo(
    "Sorry, no orders at this time for $dealerid.");
    }

    while (( 
    $row mysql_fetch_array($result))) {
    etc.... 
    I need to have " sorry, no orders..." if the $dealerid isn't in the dealercart. It won't echo "sorry, no orders..." why??

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Vernon,BC
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use

    if(!mysql_num_rows($result))
    {
    .....
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2003
    Location
    ontario
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shazir
    use

    if(!mysql_num_rows($result))
    {
    .....
    }


    SHAZIR

    BEAUTIFUL!!!! that works!!! thanks.


Bookmarks

Posting Permissions

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