Results 1 to 3 of 3

Thread: missing results...

  1. #1
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default missing results...

    When i add this code, the 1st result doesnt appear..
    PHP Code:
    if($dealsrow mysql_fetch_array($dealsrs)==0
    Heres the full code:

    PHP Code:
    // Database Stuff

    $dealsaddress "localhost";
    $dealsusername "xxxxx";
    $dealspassword "xxxxx";
    $dealsdb "xxxxx";
    $dealsconn mysql_connect($dealsaddress$dealsusername$dealspassword);
    $dealsrs mysql_select_db($dealsdb$dealsconn);
    $dealssql="SELECT * FROM xxxxx WHERE handsetid='$handsetiddb' AND tariffid LIKE '$netsearch%' ORDER BY 'total' ASC";
    $dealsrs mysql_query($dealssql$dealsconn);
    $dealsj 0;


    if(
    $dealsrow mysql_fetch_array($dealsrs)==0)
    {
    echo (
    "there are no deals..");
    }
    else
    {
    echo(
    "there are deals..");
    }

    while(
    $dealsrow mysql_fetch_array($dealsrs)) { 

    // Assigning names

    $dealsdeals $dealsrow[deals];


      echo(
    "here are the deals..$dealsdeals"); 


     
    mysql_close(); 
    anyone know how i could show the 1st result without removing that code? thanks..

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Have you tried
    PHP Code:
    if($dealsrow === mysql_fetch_array($dealsrs)) 
    ?
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I've tried that..
    If i remove it, it shows all of the results.. but i will need something there to output some code if there are no results..
    anyone got any ideas on how i could do this?

    Thanks.
    Last edited by nikomou; 04-07-2007 at 02:42 PM.

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
  •