Updating and deleting from database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RodPhp5
    New Member
    • Apr 2013
    • 4

    Updating and deleting from database

    I have to delete data from the database. here is the sample code.


    Code:
    <html>
    	<head>
    		<title>
    			Edit and delete fixtures
    		</title>
    	</head>
    		<body>
    			<?php
    					
    					$fixture_id = '';
    					$update = '';
    					$delete = '';
    					$opponents = '';
    					$date = '';
    					$venue = '';
    					$db_handle = '';
    					$submit = '';
    					
    				if (isset($_POST['submit1'])) {
    					
    					$fixture_id = $_GET['fixture_id'];
    					$update = $_POST['submit'];
    					$opponents = $_POST['opponents'];
    					$date = $_POST['date'];
    					$venue = $_POST['venue'];
    					$submit = $_POST['submit'];
    					
    					$opponents = ucwords($opponents);
    					$date = ucwords($date);
    					$venue = ucwords($venue);
    					
    					
    					$user_name = "root";
    					$password = "";
    					$database = "zebrascricketclub";
    					$server = "127.0.0.1";
    					$db_handle = mysql_connect($server, $user_name, $password);
    					$db_found = mysql_select_db($database, $db_handle);
    					
    				if($db_found) {
    					//If update is yes, the form with fixtures data will be displayed ready to be edited,else if delete is yes, then the user will be asked to confirm the action, if yes then the fixture will be deleted from the database.					if($update == 'yes') {
    					
    					echo "<form name = "form1" method = "POST" action = "delete.php">
    						 </form>";
    					
    					}
    					
    				}
    			
    					
    					
    					
    					
    						
    				}
    					
    					
    			
    
    					
    			
    				
    			?>
    		</body>
    </html>
    but i get this error Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in Z:\Program Files\EasyPHP-5.3.3\www\webfi les\delete.php on line 44
    Last edited by Rabbit; Apr 29 '13, 03:37 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Your code doesn't delete anything.

    Comment

    Working...