Re: PHP4, MySQL, errors....

From: Date: Fri, 10 Aug 2001 12:29:12 +0000
Subject: Re: PHP4, MySQL, errors....
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-11219@lists.php.net to get a copy of this message
"Cato Larsen" <ravenno1@world-online.no> wrote in message news:20010810080357.37207.qmail@pb1.pair.com... > Hey! > Thanks for the help Mr. Bothwell. > But now it seems I get a new error: ;-) The error of my ways is apparent - I typed that off the top of my head, and I got bit by my own bug - using unescaped double-quotes inside a double-quoted string. Try this: <?php $prof = "Nano-Technician"; // setup SQL statement $SQL = "SELECT * FROM memberinfo WHERE prof='$prof' "; if (!($retid = mysql_db_query($db, $SQL, $cid))) { echo( "Error: ".mysql_error()); exit; } // header row, just to set column widths $contents = row(cell("", 150) . cell("", 200) . cell("", 200)); // for each character... 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( 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>" ) ); } // print it. echo table($contents); ?>

« previous php.db (#11219) next »