Re: what is wrong with my php code?

From: Date: Mon, 03 May 2004 16:43:24 +0000
Subject: Re: what is wrong with my php code?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-185203@lists.php.net to get a copy of this message
I just made that change and am still getting the same error on line 82: the "while" line. "Edward Peloke" <epeloke@echoman.com> wrote in message news:NKEFLLFBJFIKEGAGKPCAKEKLCPAA.epeloke@echoman.com... > looks like you are missing a $ sign > > if ($rsArchives['DEPARTMENT'] != duplicate) > > shouldn't it be > if ($rsArchives['DEPARTMENT'] != $duplicate) > > > Eddie > -----Original Message----- > From: msa [mailto:melissa@maddesignusa.com] > Sent: Monday, May 03, 2004 12:29 PM > To: php-general@lists.php.net > Subject: Re: [PHP] what is wrong with my php code? > > > John Nichel" <john@kegworks.com> wrote in message > > Post some code. > > > > <?php require_once('Connections/jpike.php'); ?> > > > > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > > "http://www.w3.org/TR/html4/loose.dtd"> > > <html> > > <head> > > <title>AIA Kentucky: A Society of The American Institute of > Architects</title> > > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"> > > <link rel="stylesheet" type="text/css" href="css/news.css"> > > <style type="text/css"> > > body {margin: 0; background-color: #EBE6E0; > > background-image:url(images/backdrop.gif);} > > table {width: 100%;} > > td.header {background: url(images/header.gif) top left no-repeat;} > > td.contact {background-color: #DACEC3;} > > td.navigation {width: 146px; background-color: #DACEC3; > > font: bold italic 80% Verdana, Arial, Helvetica, sans-serif; > > border-top: 1px solid #ABADAF; border-right: 1px solid #ABADAF; > vertical-align:top;} > > td.navigation div.contact {display: block; width: 126px; color: #5B5C5E; > > padding: 4px 4px 4px 5px; margin: 5px 4px 0px 4px; > > font: normal 85% Verdana, Arial, Helvetica, sans-serif; > > background-color: #EBE6E0; border: 1px solid #5B5C5E;} > > td.navigation div.contact:hover {background-color: #EBE6E0;} > > td.navigation a.submenu {width: 126px; color: #5B5C5E; > > text-decoration:underline; > > padding: 6px 6px 6px 6px; margin: 0px 4px 0px 0px; > > font: normal 85% Verdana, Arial, Helvetica, sans-serif; > > background-color: #EBE6E0; text-align:right;} > > td.navigation a.submenu:hover {background-color: #DACEC3;} > > td.navigation a {display: block; text-decoration:none; color:#FFFFFF; > > padding: 4px 4px 4px 5px; margin: 5px 4px 0px 4px; > > background-color: #888A8D; border: 1px solid #E4E5E6;} > > td.navigation a.contact {display:inline; color: #5B5C5E; text-align:left; > > padding: 0px; margin: 0px; > > text-decoration:underline; font: normal 85% Verdana, Arial, > Helvetica, sans-serif; > > background-color: #EBE6E0; border: none;} > > td.navigation a:hover {background-color:#ABADAF;} > > td.content {vertical-align: top; padding: 1em 4em 1em 2em; > > background-color:white; font: 80% normal Verdana, Arial, > Helvetica, sans-serif; > > color: black; border-top: 1px solid #ABADAF;} > > td.content table.eMenu {width: 35%; float:right; text-align:center; > > vertical-align:center; margin: 5px;} > > td.content a.eMenu {display:block; text-transform:none; padding: > 3px; font-size:80%; > > text-decoration:none; border-bottom: 1px solid #EBE6E0; > border-top: 1px solid #EBE6E0;} > > td.content a:hover {background-color: #EBE6E0;} > > td.content a:link {color: #083E7B;} > > td.content a:visited {color: #5E1A80} > > td.rightBar a {display: block; width:150px; text-decoration:none; color: > white; > > padding: 4px 4px 4px 5px; margin: 5px -3px 0px 4px; > > background-color: #7D746B; border: 1px solid white;} > > td.rightBar a:hover {background-color: #ABADAF;} > > .bottomMenu {text-align:center; font: 85% Verdana, Arial, Sans Serif; } > > </style> > > </head> > > > > <body> > > <table cellspacing="0" > > > <tr> > > <td ></td> > > </tr> > > <tr> > > <td class="content"><h2>News</h2> > > <p>&nbsp;</p> > > <h3>E-News Archives </h3> > > <table border="0" cellspacing="0" cellpadding="0"> > > <tr> > > <td><?php > > // If MySQL is not the database type used, replace the > mysql_query() and > > // mysql_fetch_array() functions with the appropriate functions > for your database > > // type. > > // For example, msql_query() and msql_fetch_array() if you are > using a mSQL database. > > // A full PHP function list can be found at: > http://us4.php.net/manual/en/funcref.php > > > > // Mysql Query > > > > $query = "SELECT * FROM ArchiveNews"; > > $result = mysql_query($query); > > $duplicate = ''; // Define duplicate tracking variable > > > > // Cycle through records > > while($rsArchives = mysql_fetch_array($result)) > > { > > // Compare old value to new value and display column only > if they do not match > > if ($rsArchives['DEPARTMENT'] != duplicate) > > { > > ?> > > <!-- Insert a blank row to create a separation --> > > <tr> > > <td height="5">&nbsp;</td> > > <td height="5">&nbsp;</td> > > <td height="5">&nbsp;</td> > > <td height="5">&nbsp;</td> > > </tr> > > <tr> > > <td width="25%"><?php echo > $row_rsArchives['DEPARTMENT']; > ?></td> > > <td width="20%"><?php echo > $row_rsArchives['FIRSTNAME']; ?></td> > > <td width="19%"><?php echo > $row_rsArchives['LASTNAME']; ?></td> > > <td width="36%"><?php echo $row_rsArchives['PHONE']; > ?></td> > > </tr> > > <?php > > } else { > > // Display blank column if they do match > > ?> > > <tr> > > <td width="25%"></td> > > <td width="20%"><?php echo > $row_rsArchives['FIRSTNAME']; ?></td> > > <td width="19%"><?php echo > $row_rsArchives['LASTNAME']; ?></td> > > <td width="36%"><?php echo $row_rsArchives['PHONE']; > ?></td> > > </tr> > > <?php > > } > > // set duplicate variable value for next compare > > $duplicate = $rsArchives['DEPARTMENT']; > > } > > ?> > > </table> > > > > </td> > > <td>&nbsp;</td> > > <td>&nbsp;</td> > > </tr> > > </table> <p>&nbsp;</p> > > <h4>&nbsp;</h4> > > <p>&nbsp;</p></td> > > </tr> > > </table> > > </body> > > </html> > > > > > > here you go.....thanks.... > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#185203) next »