You are here: php scripts no longer working after upgrade « PHP Programming Language « IT news, forums, messages
php scripts no longer working after upgrade

Posted by cwhite on 04/02/07 15:11

i recently upgraded from fedora core 5 to cent os 4.4 with php 4.3
mysql 4.1 and apache 2.0.52, and all of the php scripts i had which
called specific entries from mysql are no longer working

if i had a link display_story.php?id=334 it would know do display the
entry which matched id 334, my code to display the entry looks like
this

<?php
$Host="localhost";
$User="user";
$Password="password";
$DBName="database";

$Link=mysql_connect($Host, $User, $Password);
$Query="SELECT * from table WHERE sid=$id;
$Result=mysql_db_query($DBName,$Query, $Link);
while($Row=mysql_fetch_array($Result)){
print("<table width=\"500\">\n");
print("<tr>\n");
print("<td valign=\"bottom\">\n");
print("<p class=\"page_title\">$Row[title]\n");
print("<p>\n");
print("<i>$Row[hometext]</i>\n");
print("</td>\n");
print("<td>\n");
$Topimage=$Row[topic];
include 'top_image.php';
print("</td>\n");
print("</tr>\n");
print("</table>\n");
print("<p>\n");
print("$Row[bodytext]\n");
print("<div align=right><a href=\"javascript: history.go(-1)\">Back</
a></div></td>\n");
}
mysql_close($Link);
?>

the error message in my logs tell me that $Query="SELECT * from table
WHERE sid=$id; is the problem

[client 204.50.205.242] PHP Notice: Undefined variable: id in
**********
[client 204.50.205.242] PHP Warning: mysql_fetch_array(): supplied
argument is not a valid mysql result resource in
*************************** on line 10

i have tried turning on register_globals but the problem persists

any ideas on how i can fix this in php.ini without having to go and re-
write all of my scripts (i'm kind of lazy today)

thanks

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация