Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error: I looked and can't find the culprit...

Status
Not open for further replies.

vavroom

IS-IT--Management
Mar 23, 2002
3
US
Hello,

I first should say that I'm a newbie at all this, having been toying with PHP for all of about 3 days...

What I want to accomplish: I have a table that contains profiles for club members. I want to a)list all the names on profiles.php3, creating a link from each name that opens up viewprofile.php3. This last page would display all the information for the member selected.

I have the code for the first page, works well enough I'd think. The problem arises once I click on the name and load viewprofile.php3. I then get a parse error pointing to line 26.

line 26 is a line that doesn't give me problems elsewhere when used (defining $db)

Could you look and see what I'm missing? Any and all suggestions appreciated. Also, if there's another way to do this, I'm open :)

code on profile.php3:
<?php
$db = mysql_connect(&quot;localhost&quot;, &quot;username&quot;,&quot;password&quot;);
mysql_select_db(&quot;ibcsite_profiles&quot;,$db);
$result = mysql_query(&quot;SELECT * FROM tblProfiles ORDER BY fldLName ASC&quot;,$db);
if ($result) {
while ($r = mysql_fetch_array($result)) {
$viewid=$r[&quot;fldProfileID&quot;];
$fname=$r[&quot;fldFName&quot;];
$lname = $r[&quot;fldLName&quot;];
echo &quot;<LI><A HREF=\&quot; }
}
?>

Code on viewprofile.php3
<?php
$db = mysql_connect(&quot;localhost&quot;, &quot;username&quot;,&quot;password&quot;) or die (mysql_error());
mysql_select_db(&quot;ibcsite_profiles&quot;,$db);

if(isset($viewid))
{
$query=&quot;SELECT * FROM tblProfiles WHERE fldProfileID=$viewid&quot;;
$result = mysql_query($query, $db);
while ($array = mysql_fetch_array($result))
{
   $name = $array[&quot;fldLName&quot;];
   echo &quot;$name&quot;;
}
}
?>

As I said, any and all help would be much appreciated.

Thx

Nic
 
Never mind, got it... Nic
&quot;You must deal with me as I think of myself&quot; J. Hockenberry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top