Log in

View Full Version : missing results...



nikomou
04-06-2007, 08:59 AM
When i add this code, the 1st result doesnt appear..

if($dealsrow = mysql_fetch_array($dealsrs)==0)

Heres the full 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..

tech_support
04-06-2007, 09:09 AM
Have you tried
if($dealsrow === mysql_fetch_array($dealsrs))?

nikomou
04-06-2007, 01:21 PM
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.