Jump to content

3.4.x PHP Pages That Stopped Working in 4.1.x


Phillyman

Recommended Posts

Posted

I have a few PHP pages that were working fine in 3.4.x. They were very simple and just gave me a quick way to find records in my IP Content Databases that were missing data. Now in 4.1.x they throw this error....

Probably worth mentioning that I went up to PHP 7.1 from 5.6, not sure if that could be the cause....but I am pretty sure that these all broke right after upgrading to IPB 4.1.x

ParseError: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) (0)
#0 /home/mysite/public_html/applications/cms/sources/Pages/Page.php(1159): IPS\_Theme::runProcessFunction('\tfunction conte...', 'content_pages_7...')
#1 /home/mysite/public_html/applications/cms/sources/Pages/Page.php(2114): IPS\cms\Pages\_Page->getHtmlContent()
#2 /home/mysite/public_html/applications/cms/modules/front/pages/page.php(72): IPS\cms\Pages\_Page->output()
#3 /home/mysite/public_html/applications/cms/modules/front/pages/page.php(44): IPS\cms\modules\front\pages\_page->view()
#4 /home/mysite/public_html/system/Dispatcher/Controller.php(96): IPS\cms\modules\front\pages\_page->manage()
#5 /home/mysite/public_html/applications/cms/modules/front/pages/page.php(34): IPS\Dispatcher\_Controller->execute()
#6 /home/mysite/public_html/system/Dispatcher/Dispatcher.php(129): IPS\cms\modules\front\pages\_page->execute()
#7 /home/mysite/public_html/index.php(13): IPS\_Dispatcher->run()
#8 {main}

 

This is the source code.....

$con=mysqli_connect("localhost","username","password","database");
// Check connection
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT `field_21`, `field_24`, `field_25`  FROM `ibf_cms_custom_database_1` WHERE `field_36`='5772' AND field_26 = 'usa' AND `record_approved`='1'
ORDER BY `ibf_cms_custom_database_1`.`field_21` ASC");

while($row = mysqli_fetch_array($result)) {
  echo $row['field_21'] . " " . $row['field_24']. " " . $row['field_25'];
  echo "<br>";
}

mysqli_close($con);

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...