[PHP] Re: Parse error not understood
//If Delete User is selected-- if ( $_REQUEST['useroption'] == 'delete') { //First, check that the user already exists $query = select count(*) from pbpc_client where username = ' . $_REQUEST['usernamebox'] . ';; $result = mysql_query($query); if(!$result) { echo 'Cannot run query.'; exit(); } $count = mysql_result($result, 0, 0); if($count==0) { //User does not exist in the database header('location: user_not_exists.php'); exit(); header('location:del_new_user.php'); exit(); } //header('location: content.php'); ? No matter which option I select I get the following output : -- Parse error: parse error, unexpected $ in /var/www/html/Sessions/userman.php on line 83 Line 83 is '?'.. You missed a '}' at lines : if($count==0) { //User does not exist in the database header('location: user_not_exists.php'); exit(); Add a '}' after this, and your problem is fixed! -- Ivo Fokkema PHP MySQL programmer Leiden University Medical Centre Netherlands -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse error not understood
Holy schmoley...something so small.I must get off this green tea, all this good health stuff is causing havoc in my brain... Thanks Fokkema, and Johnfor pointing out an obvious error... Regards On Wed, 2003-08-06 at 14:48, Fokkema, I.F.A.C. (HKG) wrote: //If Delete User is selected-- if ( $_REQUEST['useroption'] == 'delete') { //First, check that the user already exists $query = select count(*) from pbpc_client where username = ' . $_REQUEST['usernamebox'] . ';; $result = mysql_query($query); if(!$result) { echo 'Cannot run query.'; exit(); } $count = mysql_result($result, 0, 0); if($count==0) { //User does not exist in the database header('location: user_not_exists.php'); exit(); header('location:del_new_user.php'); exit(); } //header('location: content.php'); ? No matter which option I select I get the following output : -- Parse error: parse error, unexpected $ in /var/www/html/Sessions/userman.php on line 83 Line 83 is '?'.. You missed a '}' at lines : if($count==0) { //User does not exist in the database header('location: user_not_exists.php'); exit(); Add a '}' after this, and your problem is fixed! -- Ivo Fokkema PHP MySQL programmer Leiden University Medical Centre Netherlands -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 None of our men are experts. We have most unfortunately found it necessary to get rid of a man as soon as he thinks himself an expert -- because no one ever considers himself expert if he really knows his job. A man who knows a job sees so much more to be done than he has done, that he is always pressing forward and never gives up an instant of thought to how good and how efficient he is. Thinking always ahead, thinking always of trying to do more, brings a state of mind in which nothing is impossible. The moment one gets into the expert state of mind a great number of things become impossible. -- From Henry Ford Sr., My Life and Work, p. 86 (1922): -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Parse error not understood
Miles Thompson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes, I'm top posting, pls forgive. This is a situation where an editor which has built-in brace matching really helps - if in the midst of looking one remembers to use it. Another tip, although it probably wouldn't help here: Save the code with a .phps extension and look at it in the browser. I always indent statements like this : if (this) { do_this(); if (that) { do_that(); } } It helps me 'see' the code and also it's easier to track missing braces. I know people have their own coding style - I just find it easy for me. -- Ivo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Parse error not understood
Yes, I'm top posting, pls forgive. This is a situation where an editor which has built-in brace matching really helps - if in the midst of looking one remembers to use it. Another tip, although it probably wouldn't help here: Save the code with a .phps extension and look at it in the browser. Cheers - Miles At 02:59 PM 8/6/2003 +0200, Chris Blake wrote: Holy schmoley...something so small.I must get off this green tea, all this good health stuff is causing havoc in my brain... Thanks Fokkema, and Johnfor pointing out an obvious error... Regards On Wed, 2003-08-06 at 14:48, Fokkema, I.F.A.C. (HKG) wrote: //If Delete User is selected-- if ( $_REQUEST['useroption'] == 'delete') snip -- liked the Ford quote -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php