Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-20-2006, 08:29 PM Parse Error
The_Anomaly's Avatar
Extreme Talker

Posts: 216
Location: Boston, Ma
Trades: 0
Says parse error on line 85, where the while loop is. I cant seem to figure out whats wrong with it. Can anyone see anything? not sure if the code will work because i got stuck on first execute, but if i get rid of that error it will be alot easier :|

Code:
<?php require_once('Connections/nwodb.php'); ?>
<?php
$search = $_POST['search'];
$within = $_POST['within'];


mysql_select_db($database_nwodb, $nwodb);
if($within == 'Society') {
   $query_Recordset1 = "SELECT * FROM ".$within."
                        WHERE \(SocietyName LIKE '".$search."'\)
                        OR \(History LIKE '".$search."\)
                        OR \(Description LIKE '".$searcg."\)
                        ORDER BY LastName ASC";
   }else if ($within == 'People'){
    $query_Recordset1 = " SELECT * FROM ".$within."
                        WHERE \(FirstName LIKE '".$search."'\) 
                        OR \(LastName LIKE '".$search."\)
                        OR \(Picture LIKE '".$searcg."\)
                        ORDER BY LastName ASC";
   }else{ 
          echo "You didnt select what table to search. Please go back.";
   }

$Recordset1 = mysql_query($query_Recordset1, $nwodb) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>People List</title>
</head>

<body>
<table border="1" align="center">
  <tr>
<?php if($within == 'Society')
  {  echo "<table border=\"0\" align=\"center\">

        <tr> 
          <td>Society Name</td>
          <td>&nbsp;</td>
        </tr>";
         do {
        echo "<tr>
                <td align=\"left\" valign=\"top\">
                   <a href=\"societymembership.php?recordID=".$row_Recordset1['Society_ID'].";\">
                   ".$row_Recordset1['SocietyName']." &nbsp; </a>
                </td>
                <td>
                   <img src=\"".$row_Recordset1['Logo']." width=\"300\" height=\"250\" />&nbsp;
                </td>
        </tr>";
                  } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
                echo "</table>
                 <br>".$totalRows_Recordset1." Records Total </td>
               </tr>
               <tr>
               <td>&nbsp; </td>
               </tr>
       </table>";
  }else if ($within == 'People')
{

    echo " <td>Details</td>
           <td>FirstName</td>
           <td>LastName</td>
           </tr>";
do {
    echo "<tr><td><a href=\"details.php?recordID=".$row_Recordset1['Person_ID']."\">"
                  .$row_Recordset1['Person_ID'].
          "&nbsp; </a> </td><td>"
                  .$row_Recordset1['FirstName'].
          "&nbsp; </td><td>"
                  .$row_Recordset1['LastName'].
          "&nbsp; </td></tr>";
  }//close do !!!!!!!!NEXT LINE COMES UP WITH ERROR!!!!!
     while ($row_Recordset1 = mysql_fetch_assoc($Recordset1))
     {
            echo "</table><br>"
               .$totalRows_Recordset1.
             "Records Total";
      } //close while
 } //close if

 ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
The_Anomaly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-21-2006, 05:19 PM Re: Parse Error
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
What is the parse error showing?

I don't think the do... while method is going to work for what you are doing, because you are first doing something that hasn't been declared yet on the first iteration. Just try to sandwich the echo command within the while() structure.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Parse Error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09497 seconds with 12 queries