[SOLVED] upgraded now code wont work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
surban99
Forum Newbie
Posts: 14
Joined: Sat Jan 08, 2005 5:41 pm

[SOLVED] upgraded now code wont work

Post by surban99 »

first off here's my code

Code: Select all

<html>

<body>

<?php



$db = mysql_connect("localhost", "root");

mysql_select_db("test",$db);

$result = mysql_query("SELECT * FROM employees",$db);

if ($myrow = mysql_fetch_array($result)) {

  do {

    printf("<a href="%s?id=%s">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["name"], $myrow["bio"]);

  } while ($myrow = mysql_fetch_array($result));

} else {

  echo "Sorry, no records were found!";	

}

?>



</body>



</html>
this program used to work but now i get an error stating:
Notice: Undefined variable: PHP_SELF in c:\program files\easyphp\www\example4.php on line 19
someone please help me figure this one out


feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Use $_SERVER['PHP_SELF']
surban99
Forum Newbie
Posts: 14
Joined: Sat Jan 08, 2005 5:41 pm

thanks

Post by surban99 »

thanks a ton dude!! i think i love this website. that might have been the fastest reply ever
Post Reply