| | |
Parse error: syntax error, unexpected $end
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 42
Reputation:
Solved Threads: 0
Good morning, all!
As the title suggests, I am having a syntax error. I'm using Notepad++, and I don't seem to be missing any curly braces.
Is there somthing else I'm missing?
Thank you
As the title suggests, I am having a syntax error. I'm using Notepad++, and I don't seem to be missing any curly braces.
Is there somthing else I'm missing?
Thank you
PHP Syntax (Toggle Plain Text)
<?php session_start(); include('header.php'); if((isset($_GET['movie_users_id'])) && (is_numeric($_GET['movie_users_id']))) { $movie_users_id = $_GET['movie_users_id']; } elseif ((isset($_POST['movie_users_id'])) && (is_numeric($_POST['movie_users_id']))){ $movie_users_id = $_POST['movie_users_id']; } else { header("Refresh: 3;URL=current_users.php"); echo "This page has been accessed in error. Redirecting you to the previous page"; } require_once('mysql_connect'); if($_POST['sure'] == 'Yes') { $query = "delete from movie_users where movie_users_id = $movie_users_id"; $result = @mysql_query($query); } $query = "select concat(last_name, ',' first_name) from movie_users where movie_users_id = $movie_users_id"; $result = @mysql_query($query); if (mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result, MYSQL_NUM); ?> <body> <form action="delete_user.php" method ="post"> <div id="main"> <p>Are you sure you want to delet this user?<br /> <input type = "radio" name = "sure" value = "Yes" /> Yes <input type = "radio" name = "sure" value = "No" /> No</p> <p><input type = "submit" name = "submit" value = "Submit" /> </p> <input type = "hidden" name = "submitted" value = "TRUE" /> <input type = "hidden" name = "movie_users_id" value = "' . $movie_users_id . '" /> </form> </body> </div> mysql_close(); <?php include('footer.php'); ?>
•
•
Join Date: Jan 2008
Posts: 141
Reputation:
Solved Threads: 19
Where is the closing bracket for this last if statement?
•
•
•
•
PHP Syntax (Toggle Plain Text)
if (mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result, MYSQL_NUM); ?> <body> <form action="delete_user.php" method ="post"> <div id="main"> <p>Are you sure you want to delet this user?<br /> <input type = "radio" name = "sure" value = "Yes" /> Yes <input type = "radio" name = "sure" value = "No" /> No</p> <p><input type = "submit" name = "submit" value = "Submit" /> </p> <input type = "hidden" name = "submitted" value = "TRUE" /> <input type = "hidden" name = "movie_users_id" value = "' . $movie_users_id . '" /> </form> </body> </div> mysql_close(); <?php include('footer.php'); ?>
Last edited by robothy; Apr 17th, 2009 at 10:25 am.
•
•
Join Date: Oct 2008
Posts: 42
Reputation:
Solved Threads: 0
To Robothy:
Thank you for finding that missing curly brace. I had been looking for a long time, and I guess I just missed it in Notepad ++.
However, I now have a new problem. When I click "Yes" to delete the user, the user never gets deleted. I ran the exact same query in the regular MySQL database and it worked. Something else I'm missing?
Thank you for finding that missing curly brace. I had been looking for a long time, and I guess I just missed it in Notepad ++.
However, I now have a new problem. When I click "Yes" to delete the user, the user never gets deleted. I ran the exact same query in the regular MySQL database and it worked. Something else I'm missing?
PHP Syntax (Toggle Plain Text)
<?php session_start(); include('header.php'); if((isset($_GET['id'])) && (is_numeric($_GET['id']))) { $id = $_GET['id']; } elseif (isset($_POST['id'])){ $id = $_POST['id']; } else { header("Refresh: 60;URL=current_users.php"); echo "This page has been accessed in error. Redirecting you to the previous page".mysql_error(); } require_once('mysql_connect.php'); if(isset($_POST['submitted'])){ if($_POST['sure'] == 'Yes') { $query = "delete from movie_users where movie_users_id = $id"; $result = @mysql_query($query); header("Refresh: 3;URL=current_users.php"); echo "User deleted successfully"; } $query = "select concat(last_name, ',' first_name) from movie_users where movie_users_id = $id"; $result = @mysql_query($query); if (mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result, MYSQL_NUM); } } ?> <body> <form action="delete_user.php" method ="post"> <div id="main"> <p>Are you sure you want to delete this user?<br /> <input type = "radio" name = "sure" value = "Yes" /> Yes <input type = "radio" name = "sure" value = "No" /> No</p> <p><input type = "submit" name = "submit" value = "Submit" /> </p> <input type = "hidden" name = "submitted" value = "TRUE" /> <input type = "hidden" name = "id" value = "' . $id . '" /> </form> </body> </div> mysql_close(); <?php include('footer.php'); ?>
![]() |
Similar Threads
- syntax error, unexpected $end (PHP)
- Parse error: syntax error, unexpected $end in (PHP)
- syntax error, unexpected $end in ndex.php on line 127 (PHP)
- Parse error: syntax error, unexpected $end (PHP)
- Parse error: syntax error, unexpected $end (PHP)
Other Threads in the PHP Forum
- Previous Thread: Multiple values in one cookie
- Next Thread: posting a multiple select form object
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array autosuggest beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email emptydisplayvalue error explodefunction file files folder form forms function functions google hack href htaccess html image include insert integration ip java javascript joomla keywords limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search searchbox select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video web website xml youtube





