Re: PHP4, MySQL, errors....

From: Date: Fri, 10 Aug 2001 08:03:32 +0000
Subject: Re: PHP4, MySQL, errors....
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-11211@lists.php.net to get a copy of this message
Hey! Thanks for the help Mr. Bothwell. But now it seems I get a new error: Parse error: parse error in C:\Program Files\Apache Group\Apache\htdocs/oiamemb/members.php on line 89 I don't know why, or if it's the MySQL database who's moching with me. The current source is as follows: (Guess I've screwed it up worse than ever...) Thanks to all the people who have helped me. This is my first try at PHP, and MySQL for that matter so I realy apreciate it! Best regards Cato ------------> Code start <? $usr = "Xephiroth"; $pwd = "lordoftherings"; $db = "members"; $host = "localhost"; # connect to database $cid = mysql_connect($host,$usr,$pwd); if (!$cid) { echo "Error: ".mysql_error(); exit; } ?> <html> <head> <title>Profiles</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/back.gif" bgproperties="fixed"> <? $str = "PHP is not running!"; echo substr($str, 0, 7) . substr($str, 11); ?> <? $prof = "Nano-Technician"; # setup SQL statement $SQL = "SELECT * FROM memberinfo "; $retid = mysql_db_query($db, $SQL, $cid); # check for errors if (!$retid) { echo( mysql_error()); } else { # display results while ($row = mysql_fetch_array($retid)) { $email = $row["email"]; $loc = $row["loc"]; $aim = $row["aim"]; $icq = $row["icq"]; $msn = $row["msn"]; $yahoo = $row["yahoo"]; $charname = $row["charname"]; $charsname = $row["charsname"]; $charnick = $row["charnick"]; $tit = $row["tit"]; $lvl = $row["lvl"]; $picurl = $row["picurl"]; $born = $row["born"]; $apperiance = $row["apperiance"]; $charac = $row["charac"]; $streng = $row["streng"]; $bio = $row["bio"]; $breed = $row["breed"]; $prof = $row["prof"]; $posn = $row["posn"]; $contents = row(cell("", 150) . cell("", 200) . cell("", 200)); while ($row = mysql_fetch_array($retid)) $contents .= row( cell("<img src='{$row["picurl"]}'>") .cell( bold( "{$row["tit"]} {$row["charname"]} " ."&quot;{$row["charnick"]}&quot;" ."{$row["charsname"]}" )."<br>" .bold("Contact: ").$row["email"]."<br>" .bold("Level: ").$row["lvl"]."<br>" .bold("Breed: ").$row["breed"]."<br>" .bold("Profession: ").$prof."<br>" .bold("Location: ").$row["loc"]."<br>" .bold("AIM: ").$row["aim"]."<br>" .bold("ICQ: ").$row["icq"]."<br>" .bold("MSN: ").$row["msn"]."<br>" .bold("Yahoo!: ").$row["yahoo"]."<br>" ) .cell( "<br>" .bold("Born: ").$row["born"]."<br>" .bold("Appearance: ").$row["appearance"]."<br>" .bold("Position: ").$row["posn"]."<br>" .bold("Characteristics: ").$row["charac"]."<br>" .bold("Strengths/weaknesses: ").$row["streng"]."<br>" .bold("Bio: ").$row["bio"]."<br>" ) ); echo table($contents); ) ?> </body> </html> <-------------- Code end

« previous php.db (#11211) next »