Jump to content

If no Queries Found


LightningSt

Recommended Posts

that was more of a just how do you do it in general but as for actual code here we go, maybe even whille your at it... the elseif statement isn't working... when i type into the fFirst field and not the fLast and submit it does nothing... but just the else and if work... It will echo the fields are blank or it will do it if there is nothing there

 

if($fFirst == "" AND $fLast == ""){echo "The Required Fields are blank, Please fill them in!";}
//Broken Elseif statement, repair in the future (Work)
elseif($fLast == ""){$fResult = mysql_query("SELECT * FROM ci WHERE first='$fFirst'");}
elseif($fFirst == ""){$fResult = mysql_query("SELECT * FROM ci WHERE last='$fLast'");}
// End of Broken
else{$fResult = mysql_query("SELECT * FROM ci WHERE first='$fFirst' AND last='$fLast'");}
$fResult = mysql_query("SELECT * FROM ci WHERE first='$fFirst' AND last='$fLast'");

Link to comment
https://forums.phpfreaks.com/topic/106096-if-no-queries-found/#findComment-543790
Share on other sites

Yes Thank you that solves my first problem with the if there is no query... now for the elseif statement

 

using the MySql_Num_Rows has allowed me to know that if you fill out only one field, like the elseif statements are trying to say, then it can't find anything in the database

Link to comment
https://forums.phpfreaks.com/topic/106096-if-no-queries-found/#findComment-543793
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.