Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.