Jump to content


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


terminating code

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..";
for($i=0;$i<mysql_num_rows($res);$i++) {
// 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\" /]

Share this post

Link to post
Share on other sites
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]use exist()[/quote]
That would be exit().

Share this post

Link to post
Share on other sites


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.