Migration to PHP 4.4.2 breaks application
Posted: Fri Feb 22, 2008 12:49 pm
My site recently changed it's version of PHP from 4.3.2 to 4.4.2, and in doing so was moved from one server to another. Unfortunately this seems to have broken several of my scripts. I'm running PHPBB3 which is working fine, and Gallery2 which is working fine, however the following bit of code is one example which used to successfully query a database but now fails to return a result under 4.4.2:
-----------------------------------
The link to this page can be found here
http://www.marshallcrenshaw.com/venue.php?venueid=62
Before the switch to 4.4.2 this returned the text of an article from a database. I have several support requests in with my host but they seem unable to solve the problem. My question is, is there something about the above bit of code that is now incompatible with PHP 4.4.2 ?
Mod | Please use
Code: Select all
<?
include"lib/common.php";
$sql1='select articles_table.id, DATE_FORMAT(articles_table.date, "%b %d %Y") as formatted_date, articles_table.publication, articles_table.title, articles_table.author
from articles_table
order by articles_table.date asc';
$res1=mysql_query($sql1);
$count=0;
$year=$_GET[year];
print "<table width=\"auto\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"0\" valign=\"top\" >";
while($row=@mysql_fetch_array($res1))
{
$dat=$row[formatted_date];
$dat=substr($dat,7);
if ($dat==$year && isset($row[id]))
{
print "<tr valign=top class=\"firstnormal\"><td nowrap>$row[formatted_date]</td><td>$row[publication]</td><td><a href=\"articletext.php?articleid=$row[id]\">$row[title]</a></td>
<td>by $row[author]</td></tr>";
}
$row=@mysql_fetch_array($res1);
$dat=$row[formatted_date];
$dat=substr($dat,7);
if($dat==$year && isset($row[id]))
{
print "<tr valign=top class=\"secondnormal\"><td nowrap>$row[formatted_date]</td><td>$row[publication]</td><td><a href=\"articletext.php?articleid=$row[id]\">$row[title]</a></td>
<td>by $row[author]</td></tr>";
}
}
print"<tr class=\"input\" align=\"center\"><td colspan=\"5\"></td></tr></table>";
?></td>
The link to this page can be found here
http://www.marshallcrenshaw.com/venue.php?venueid=62
Before the switch to 4.4.2 this returned the text of an article from a database. I have several support requests in with my host but they seem unable to solve the problem. My question is, is there something about the above bit of code that is now incompatible with PHP 4.4.2 ?
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Mod | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]