Where is the unexpected end on line 130?

Here is the code where on line 130 there is an unexpected $end I can't find.

<?php
$level = '3';
include('../../lib/root.inc.php');
include($rootpath . 'lib/connect_tools.php');
include($rootpath . 'lib/functions.php');
include($rootpath . 'lib/settings.php');

$MM_authorizedUsers = "pub";

include($rootpath . 'lib/authenticate.php');

$pageTitle = "Publication Author Audit";

include($rootpath . 'lib/session_info.php');



// PUBLICATIONS DATA CALL
mysql_select_db($database_mainbase, $mainbase);
$query_PUBLICATIONS = "SELECT id, title, year, status, pub_id, section_id FROM publications, publications_section_xref WHERE pub_id = id ORDER by section_id ASC";
$PUBLICATIONS = mysql_query($query_PUBLICATIONS, $mainbase) or die(mysql_error());
$row_PUBLICATIONS = mysql_fetch_assoc($PUBLICATIONS);
$totalRows_PUBLICATIONS = mysql_num_rows($PUBLICATIONS);

      
include($rootpath . 'parts/navigation.php');
include($rootpath . 'parts/headmeta.php');
include($rootpath . 'parts/tools_header.php');


// AUTHOR NAME DATA CALL
$query_AUTHOR_NAME = "SELECT id, pub_id, author_name FROM publications_authors_xref WHERE pub_id = '" . $row_PUBLICATIONS['id'] . "' ORDER by id ASC";
$AUTHOR_NAME = mysql_query($query_AUTHOR_NAME, $mainbase) or die(mysql_error());
$row_AUTHOR_NAME = mysql_fetch_assoc($AUTHOR_NAME);
$totalRows_AUTHOR_NAME = mysql_num_rows($AUTHOR_NAME);

      do {
      if (isset($rows_AUTHOR_NAME['id']) AND ($rows_AUTHOR_NAME['id'] != ("" OR NULL))) {
            if (isset($rows_AUTHOR_NAME['author_name']) AND ($rows_AUTHOR_NAME['author_name'] != ("" OR NULL))) {
            echo 'Audit successful, you did not have any null author ids or null author names.' ;
      }
      else {
            if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == ("" OR NULL))) {
      }
            if (isset($row_AUTHOR_NAME['author_name']) AND ($row_AUTHOR_NAME['author_name'] == ("" OR NULL))) {
             
print '
      <table class="border">
            <tr>
                  <th width="5%">Pub Id</th>
                  <th width="8%">Year</th>
                  <th width="7%">Branch</th>
                  <th>Author Id</td>
                  <th width="15%">Author Name</th>
                  <th width="55%">Title</th>
                  <th width="10%">Status</th>
            </tr>
            
';

// ORG. CODE DATA CALL
$query_ORG_CODE = "SELECT org_code, pub_id, section_id, id FROM section, publications_section_xref WHERE pub_id = '" . $row_PUBLICATIONS['id'] . "' AND section_id = id ORDER by section_id ASC";
$ORG_CODE = mysql_query($query_ORG_CODE, $mainbase) or die(mysql_error());
$row_ORG_CODE = mysql_fetch_assoc($ORG_CODE);
$totalRows_ORG_CODE = mysql_num_rows($ORG_CODE);


                  
// LOOP FOR PUBLICATION + AUTHOR NAME + BRANCH DATA            
echo"<tr>";      
                  echo"<td>";
                  if (isset($row_PUBLICATIONS['id']) AND ($row_PUBLICATIONS['id'] == ("" OR NULL))) {
                        echo 'No Id' ;
                  }
                  else {
                        echo $row_PUBLICATIONS['id'];
                  }
                  echo"</td>";
                echo"<td>";
                  if (isset($row_PUBLICATIONS['year']) AND ($row_PUBLICATIONS['year'] == ("" OR NULL))) {
                        echo 'No Year' ;
                  }
                  else {
                        echo $row_PUBLICATIONS['year'];
                  }
                  echo"</td>";
                  echo"<td>";
                  if ($row_ORG_CODE['org_code'] == ("" OR NULL)) {
                        echo '<font color="#FF3300">NULL' ;
                  }
                  else {
                        echo $row_ORG_CODE['org_code'];       
                  }
                  echo"</td>";
                  echo"<td>";
                  if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == ("" OR NULL))) {
                        echo '<font color="#FF3300">NULL' ;
                  }
                  echo"</td>";
                  echo"<td>";
                  if  ($row_AUTHOR_NAME['author_name'] == ("" OR NULL)) {
                        echo '<font color="#FF3300">NULL' ;
                  }
                  echo"</td>";
                  echo"<td>";
                  if (isset($row_PUBLICATIONS['title']) AND ($row_PUBLICATIONS['title'] == ("" OR NULL))) {
                        echo 'No Title' ;
                  }
                  else {
                        echo $row_PUBLICATIONS['title'];       
                  }
                  echo"</td>";
                  echo"<td>";
                  if (isset($row_PUBLICATIONS['status']) AND ($row_PUBLICATIONS['status'] == ("i"))) {
                        echo  '<font color="#C59E67">Inactive' ;
                  }
                  if (isset($row_PUBLICATIONS['status']) AND ($row_PUBLICATIONS['status'] == ("a"))) {
                        echo  'Active' ;
                  }
                  echo"</td>";
echo"</tr>";
                  
} while ($row_PUBLICATIONS = mysql_fetch_assoc($PUBLICATIONS));

      print '
                              </table>
    ';      

include($rootpath . 'parts/tools_footer.php');
?>
dangolf6Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
The following if do not have a closing bracket:


     if (isset($rows_AUTHOR_NAME['id']) AND ($rows_AUTHOR_NAME['id'] != ("" OR NULL))) {
            if (isset($rows_AUTHOR_NAME['author_name']) AND ($rows_AUTHOR_NAME['author_name'] != ("" OR NULL))) {
            echo 'Audit successful, you did not have any null author ids or null author names.' ;
--------- } ????
      }
      else {
            if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == ("" OR NULL))) {
      }
            if (isset($row_AUTHOR_NAME['author_name']) AND ($row_AUTHOR_NAME['author_name'] == ("" OR NULL))) {
---------- } ????


Also the condition is wrong for:
$row_AUTHOR_NAME['author_name'] == ("" OR NULL)
must be

($row_AUTHOR_NAME['author_name'] == "") || ($row_AUTHOR_NAME['author_name'] == NULL)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hieloCommented:
it would help you identify the problem if you indent your code.
<?php
$level = '3';
include('../../lib/root.inc.php');
include($rootpath . 'lib/connect_tools.php');
include($rootpath . 'lib/functions.php');
include($rootpath . 'lib/settings.php');

$MM_authorizedUsers = "pub";

include($rootpath . 'lib/authenticate.php');

$pageTitle = "Publication Author Audit";

include($rootpath . 'lib/session_info.php');



// PUBLICATIONS DATA CALL
mysql_select_db($database_mainbase, $mainbase);
$query_PUBLICATIONS = "SELECT id, title, year, status, pub_id, section_id FROM publications, publications_section_xref WHERE pub_id = id ORDER by section_id ASC";
$PUBLICATIONS = mysql_query($query_PUBLICATIONS, $mainbase) or die(mysql_error());
$row_PUBLICATIONS = mysql_fetch_assoc($PUBLICATIONS);
$totalRows_PUBLICATIONS = mysql_num_rows($PUBLICATIONS);

      
include($rootpath . 'parts/navigation.php');
include($rootpath . 'parts/headmeta.php');
include($rootpath . 'parts/tools_header.php');


// AUTHOR NAME DATA CALL
$query_AUTHOR_NAME = "SELECT id, pub_id, author_name FROM publications_authors_xref WHERE pub_id = '" . $row_PUBLICATIONS['id'] . "' ORDER by id ASC";
$AUTHOR_NAME = mysql_query($query_AUTHOR_NAME, $mainbase) or die(mysql_error());
$row_AUTHOR_NAME = mysql_fetch_assoc($AUTHOR_NAME);
$totalRows_AUTHOR_NAME = mysql_num_rows($AUTHOR_NAME);

do {
//###You need to close the following IF clause
      if (isset($rows_AUTHOR_NAME['id']) AND ($rows_AUTHOR_NAME['id'] != ("" OR NULL))) {
            	if (isset($rows_AUTHOR_NAME['author_name']) AND ($rows_AUTHOR_NAME['author_name'] != ("" OR NULL))) {
            		echo 'Audit successful, you did not have any null author ids or null author names.' ;
      		}
      		else {

            		if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == ("" OR NULL))) {
      			}
//### You need to close the following IF clause
            		if (isset($row_AUTHOR_NAME['author_name']) AND ($row_AUTHOR_NAME['author_name'] == ("" OR NULL))) {
                  
                            print '
                                    <table class="border">
                                          <tr>
                                                <th width="5%">Pub Id</th>
                                                <th width="8%">Year</th>
                                                <th width="7%">Branch</th>
                                                <th>Author Id</td>
                                                <th width="15%">Author Name</th>
                                                <th width="55%">Title</th>
                                                <th width="10%">Status</th>
                                          </tr>
                                          
                            ';
               
                            // ORG. CODE DATA CALL
                            $query_ORG_CODE = "SELECT org_code, pub_id, section_id, id FROM section, publications_section_xref WHERE pub_id = '" . $row_PUBLICATIONS['id'] . "' AND section_id = id ORDER by section_id ASC";
                            $ORG_CODE = mysql_query($query_ORG_CODE, $mainbase) or die(mysql_error());
                            $row_ORG_CODE = mysql_fetch_assoc($ORG_CODE);
                            $totalRows_ORG_CODE = mysql_num_rows($ORG_CODE);
          
          
                            
          			   // LOOP FOR PUBLICATION + AUTHOR NAME + BRANCH DATA            
          			   echo"<tr>";      
          	             echo"<td>";
                            if (isset($row_PUBLICATIONS['id']) AND ($row_PUBLICATIONS['id'] == ("" OR NULL))) {
                                  echo 'No Id' ;
                            }
                            else {
                                  echo $row_PUBLICATIONS['id'];
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_PUBLICATIONS['year']) AND ($row_PUBLICATIONS['year'] == ("" OR NULL))) {
                                  echo 'No Year' ;
                            }
                            else {
                                  echo $row_PUBLICATIONS['year'];
                            }
                            echo"</td>";
                            echo"<td>";
                            if ($row_ORG_CODE['org_code'] == ("" OR NULL)) {
                                  echo '<font color="#FF3300">NULL' ;
                            }
                            else {
                                  echo $row_ORG_CODE['org_code'];       
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == ("" OR NULL))) {
                                  echo '<font color="#FF3300">NULL' ;
                            }
                            echo"</td>";
                            echo"<td>";
                            if  ($row_AUTHOR_NAME['author_name'] == ("" OR NULL)) {
                                  echo '<font color="#FF3300">NULL' ;
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_PUBLICATIONS['title']) AND ($row_PUBLICATIONS['title'] == ("" OR NULL))) {
                                  echo 'No Title' ;
                            }
                            else {
                                  echo $row_PUBLICATIONS['title'];       
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_PUBLICATIONS['status']) AND ($row_PUBLICATIONS['status'] == ("i"))) {
                                  echo  '<font color="#C59E67">Inactive' ;
                            }
                            if (isset($row_PUBLICATIONS['status']) AND ($row_PUBLICATIONS['status'] == ("a"))) {
                                  echo  'Active' ;
                            }
                            echo"</td>";
          			   echo"</tr>";
                  
} while ($row_PUBLICATIONS = mysql_fetch_assoc($PUBLICATIONS));

      print '
                              </table>
    ';      

include($rootpath . 'parts/tools_footer.php');
?>

Open in new window

0
dangolf6Author Commented:
I did everything you mentioned.
No I get this:

"unexpected T_IF on line 45".

The code from line 37 to line 46 is attached.

Thanks,
dangolf6



	do {
	if (isset($rows_AUTHOR_NAME['id']) AND ($rows_AUTHOR_NAME['id'] != ("" OR NULL))) {
		if (isset($rows_AUTHOR_NAME['author_name']) AND ($rows_AUTHOR_NAME['author_name'] != ("" OR NULL))) {
		echo 'Audit successful, you did not have any null author ids or null author names.' ;
		}
	}
	else {
		if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == "") || ($row_AUTHOR_NAME['id'] == NULL) 
			if (isset($row_AUTHOR_NAME['author_name']) AND ($row_AUTHOR_NAME['author_name'] == "") || ($row_AUTHOR_NAME['author_name'] == NULL) {
		}
 		

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

huchimCommented:
if (isset($row_AUTHOR_NAME['id']) AND ($row_AUTHOR_NAME['id'] == "") || ($row_AUTHOR_NAME['id'] == NULL)

if ( isset( $row_AUTHOR_NAME['id'] ) AND ( $row_AUTHOR_NAME['id'] == "" ) ||  ( $row_AUTHOR_NAME['id'] == NULL)  )  <----
0
hieloCommented:
you can use the empty() as well.Ex - instead of:

($row_PUBLICATIONS['year'] == ("" OR NULL))

try:
empty($row_PUBLICATIONS['year'])
0
hieloCommented:

<?php
$level = '3';
include('../../lib/root.inc.php');
include($rootpath . 'lib/connect_tools.php');
include($rootpath . 'lib/functions.php');
include($rootpath . 'lib/settings.php');

$MM_authorizedUsers = "pub";

include($rootpath . 'lib/authenticate.php');

$pageTitle = "Publication Author Audit";

include($rootpath . 'lib/session_info.php');



// PUBLICATIONS DATA CALL
mysql_select_db($database_mainbase, $mainbase);
$query_PUBLICATIONS = "SELECT id, title, year, status, pub_id, section_id FROM publications, publications_section_xref WHERE pub_id = id ORDER by section_id ASC";
$PUBLICATIONS = mysql_query($query_PUBLICATIONS, $mainbase) or die(mysql_error());
$row_PUBLICATIONS = mysql_fetch_assoc($PUBLICATIONS);
$totalRows_PUBLICATIONS = mysql_num_rows($PUBLICATIONS);

      
include($rootpath . 'parts/navigation.php');
include($rootpath . 'parts/headmeta.php');
include($rootpath . 'parts/tools_header.php');


// AUTHOR NAME DATA CALL
$query_AUTHOR_NAME = "SELECT id, pub_id, author_name FROM publications_authors_xref WHERE pub_id = '" . $row_PUBLICATIONS['id'] . "' ORDER by id ASC";
$AUTHOR_NAME = mysql_query($query_AUTHOR_NAME, $mainbase) or die(mysql_error());
$row_AUTHOR_NAME = mysql_fetch_assoc($AUTHOR_NAME);
$totalRows_AUTHOR_NAME = mysql_num_rows($AUTHOR_NAME);

do {
//###You need to close the following IF clause
      if (isset($rows_AUTHOR_NAME['id']) AND empty($rows_AUTHOR_NAME['id']) ) {
                if (isset($rows_AUTHOR_NAME['author_name']) AND empty($rows_AUTHOR_NAME['author_name']) ) {
                        echo 'Audit successful, you did not have any null author ids or null author names.' ;
                }
                else {

                        if (isset($row_AUTHOR_NAME['id']) AND empty($row_AUTHOR_NAME['id']) ){
                        }
//### You need to close the following IF clause
                        if (isset($row_AUTHOR_NAME['author_name']) AND empty($row_AUTHOR_NAME['author_name']) ) {
                  
                            print '
                                    <table class="border">
                                          <tr>
                                                <th width="5%">Pub Id</th>
                                                <th width="8%">Year</th>
                                                <th width="7%">Branch</th>
                                                <th>Author Id</td>
                                                <th width="15%">Author Name</th>
                                                <th width="55%">Title</th>
                                                <th width="10%">Status</th>
                                          </tr>
                                          
                            ';
               
                            // ORG. CODE DATA CALL
                            $query_ORG_CODE = "SELECT org_code, pub_id, section_id, id FROM section, publications_section_xref WHERE pub_id = '" . $row_PUBLICATIONS['id'] . "' AND section_id = id ORDER by section_id ASC";
                            $ORG_CODE = mysql_query($query_ORG_CODE, $mainbase) or die(mysql_error());
                            $row_ORG_CODE = mysql_fetch_assoc($ORG_CODE);
                            $totalRows_ORG_CODE = mysql_num_rows($ORG_CODE);
          
          
                            
                                   // LOOP FOR PUBLICATION + AUTHOR NAME + BRANCH DATA            
                                   echo"<tr>";      
                             echo"<td>";
                            if (isset($row_PUBLICATIONS['id']) AND empty($row_PUBLICATIONS['id']) ) {
                                  echo 'No Id' ;
                            }
                            else {
                                  echo $row_PUBLICATIONS['id'];
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_PUBLICATIONS['year']) AND empty($row_PUBLICATIONS['year']) {
                                  echo 'No Year' ;
                            }
                            else {
                                  echo $row_PUBLICATIONS['year'];
                            }
                            echo"</td>";
                            echo"<td>";
                            if ( empty($row_ORG_CODE['org_code'])) {
                                  echo '<font color="#FF3300">NULL' ;
                            }
                            else {
                                  echo $row_ORG_CODE['org_code'];       
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_AUTHOR_NAME['id']) AND empty($row_AUTHOR_NAME['id']) ) {
                                  echo '<font color="#FF3300">NULL' ;
                            }
                            echo"</td>";
                            echo"<td>";
                            if  ($row_AUTHOR_NAME['author_name'] == ("" OR NULL)) {
                                  echo '<font color="#FF3300">NULL' ;
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_PUBLICATIONS['title']) AND empty($row_PUBLICATIONS['title']) ) {
                                  echo 'No Title' ;
                            }
                            else {
                                  echo $row_PUBLICATIONS['title'];       
                            }
                            echo"</td>";
                            echo"<td>";
                            if (isset($row_PUBLICATIONS['status']) AND ($row_PUBLICATIONS['status'] == ("i"))) {
                                  echo  '<font color="#C59E67">Inactive' ;
                            }
                            if (isset($row_PUBLICATIONS['status']) AND ($row_PUBLICATIONS['status'] == ("a"))) {
                                  echo  'Active' ;
                            }
                            echo"</td>";
                                   echo"</tr>";
					}
		}
                  
} while ($row_PUBLICATIONS = mysql_fetch_assoc($PUBLICATIONS));

      print '
                              </table>
    ';      

include($rootpath . 'parts/tools_footer.php');
?>

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.