Re: Re: PHP4, MySQL, errors....

From: Date: Fri, 10 Aug 2001 14:13:42 +0000
Subject: Re: Re: PHP4, MySQL, errors....
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11221@lists.php.net to get a copy of this message
It appears that the error is pointing to the last line of your code (just by a quick count of the lines). This normally means that you are missing a closing bracket somewhere in your code. In glancing through your code, the first while statement has an opening, but no closing bracket (unless that is a typo). I also noted that your second while statement has no opening or closing brackets. HTH Maureen Cato Larsen <ravenno1@world-online.no> said: > Hey! > Thanks for the help Mr. Bothwell. > But now it seems I get a new error: > Parse error: parse error in C:Program FilesApache > GroupApachehtdocs/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 > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > --

« previous php.db (#11221) next »