Jump to content

terminating code


gladiator83x

Recommended Posts

Hey All,

I was just wondering if there was any way that I can terminate my code in php? Is there some sort of break command that will stop the compiler from executing the rest of the code? This is a tidbit of my code:

--------------------------------------------------------------------------------------------------------
$res=mysql_query("select * from End_Review");
if(mysql_num_rows($res)==0) echo "there is no data in table..";
else{
for($i=0;$i<mysql_num_rows($res);$i++) {
$row=mysql_fetch_assoc($res);
// echo $row[topic_title];
}
if ($title==$row[topic_title]) echo '<FONT COLOR=<"FF0000">"A closing time stamp already exists for this topic. Please observe the cycle.</FONT> ';

}
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]mysql_query("INSERT INTO End_Review
(id,topic_title, date) VALUES('','$title','$test_date' ) ")
or die(mysql_error());[!--colorc--][/span][!--/colorc--]
//}
-------------------------------------------------------------------------------------------------------

I just wanted the code to basically stop if ($title==$row[topic_title]) and not go into the red mysql query section. Could someone please help me? [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]


Link to comment
https://forums.phpfreaks.com/topic/12036-terminating-code/
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.