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("localhost", "username","password"
mysql_select_db("ibcsite_profiles",$db);
$result = mysql_query("SELECT * FROM tblProfiles ORDER BY fldLName ASC",$db);
if ($result) {
while ($r = mysql_fetch_array($result)) {
$viewid=$r["fldProfileID"];
$fname=$r["fldFName"];
$lname = $r["fldLName"];
echo "<LI><A HREF=\" }
}
?>
Code on viewprofile.php3
<?php
$db = mysql_connect("localhost", "username","password" or die (mysql_error());
mysql_select_db("ibcsite_profiles",$db);
if(isset($viewid))
{
$query="SELECT * FROM tblProfiles WHERE fldProfileID=$viewid";
$result = mysql_query($query, $db);
while ($array = mysql_fetch_array($result))
{
$name = $array["fldLName"];
echo "$name";
}
}
?>
As I said, any and all help would be much appreciated.
Thx
Nic
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("localhost", "username","password"
mysql_select_db("ibcsite_profiles",$db);
$result = mysql_query("SELECT * FROM tblProfiles ORDER BY fldLName ASC",$db);
if ($result) {
while ($r = mysql_fetch_array($result)) {
$viewid=$r["fldProfileID"];
$fname=$r["fldFName"];
$lname = $r["fldLName"];
echo "<LI><A HREF=\" }
}
?>
Code on viewprofile.php3
<?php
$db = mysql_connect("localhost", "username","password" or die (mysql_error());
mysql_select_db("ibcsite_profiles",$db);
if(isset($viewid))
{
$query="SELECT * FROM tblProfiles WHERE fldProfileID=$viewid";
$result = mysql_query($query, $db);
while ($array = mysql_fetch_array($result))
{
$name = $array["fldLName"];
echo "$name";
}
}
?>
As I said, any and all help would be much appreciated.
Thx
Nic