Moron Posted August 23, 2007 Share Posted August 23, 2007 My first query is: $RESULTDS=mssql_query("SELECT DV.[FY], DV.[EmpNo], DV.[NAME], DV.[EmpNo], M2.[NAMEL], M2.[NAMEF], M2.[NAMEMI], M2.[MSSNO], DV.[DATE OF SERVICE], DV.[^], DV.[sER(D-O-V-H)], DV.[CONSIDER], DV.[REIMBURSE] FROM DentalVisionHearing DV JOIN MASTERL2 M2 ON M2.[EMPNO]=DV.EmpNo WHERE M2.[MSSNO] = '".$_SESSION['password']."' and DV.[FY] = '$fiscal' ORDER BY DV.[FY] desc"); $RESULT=mssql_fetch_assoc($RESULTDS) or die ("You have none"); If nothing meets the desired query criteria, how do I code this to go on and run the remaining code on the page instead of just saying "You have none?" Link to comment https://forums.phpfreaks.com/topic/66383-if-or-die-can-you-execute-the-rest-of-the-page/ Share on other sites More sharing options...
Barand Posted August 23, 2007 Share Posted August 23, 2007 Firstly, put the die on the query in case there is an error in the query. one way <?php if ($RESULT=mssql_fetch_assoc($RESULTDS) ) { do { // echo results } while ($RESULT=mssql_fetch_assoc($RESULTDS) ); } else echo "You have none"; Link to comment https://forums.phpfreaks.com/topic/66383-if-or-die-can-you-execute-the-rest-of-the-page/#findComment-332217 Share on other sites More sharing options...
phpSensei Posted August 23, 2007 Share Posted August 23, 2007 Like what he said up there... It is best you put die(mysql_error()); so you know exactly what is wrong with the query, or why the script stopped. Link to comment https://forums.phpfreaks.com/topic/66383-if-or-die-can-you-execute-the-rest-of-the-page/#findComment-332218 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.