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?
 
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
 
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.