Parse error: syntax error, unexpected T_ELSE

Discussion in 'PHP' started by whateveritis, Oct 21, 2010.

  1. #1
    I have followed an example from a website to delete a record from database but i have modified some of the field

    <?php
    	$msg="";
    	
    	$con = mysql_connect("localhost","root","");
    	if (!$con)
      	{
      			die('Could not connect: ' . mysql_error());
      	}
    
    	mysql_select_db("aaa", $con);
    	
    	$msg="";
    	
    	if(isset($_REQUEST['id']));
    	{
    		$id=$_REQUEST['id'];
    	}
    	else
    	{
    		$id="";
    		$msg=$msg."Please enter your ID. <a href='toDelete.php'>Try again</a><br>";
    	}
    	
    	if($id!="")
    	{
    		$query="DELETE FROM aab WHERE id='$id'";
    		mysql_query($query);
    		$msg=$msg."Record was successfully deleted. <a href='toDelete.php'>Delete another</a>";
    	}
    	
    	print "$msg";
    ?>
    PHP:
    i've got error at line 18 which is the else statement, does anyone know where actually went wrong?
     
    whateveritis, Oct 21, 2010 IP
  2. whateveritis

    whateveritis Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nvm, i got it already -.-! how do i delete this post?
     
    whateveritis, Oct 21, 2010 IP
  3. pro-php-developer

    pro-php-developer Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You may delete this ,or it can be useful for somebody who faces such issue
     
    pro-php-developer, Oct 21, 2010 IP
  4. whateveritis

    whateveritis Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    since i don't know where is the delete button so i guess i'll just help lol

    i put a colon symbol ( ; ) after my if statement lol
     
    whateveritis, Oct 21, 2010 IP
    Fracisc likes this.