I have a query that I expect to return 3 or 4 entries -- but I seem to be
getting only the most recent entry, repeated 4 times. What am I doing wrong
here?
$query="SELECT artistID,email, city,state,coun try from artists WHERE
email='$email'" ;
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
if (mysql_num_rows ($result) > 0){
$alreadylisted = "1";
echo "<CENTER>$e mail is already in our database. Are you listed
below?</CENTER><BR>";
while($row = mysql_fetch_arr ay($result)) {
$artistID = $row['artistID'];
$email = $row['email'];
$city = $row['city'];
$state = $row['state'];
$country = $row['country'];
echo "<CENTER><HR><F ONT size=\"2\" face=\"Arial, Helvetica,
sans-serif\">
<A HREF=\"javascri pt:;\"
onClick=\"openP rofile('artist. php?artistID=". $artistID.
"','Artist','re sizable=yes,wid th=600,height=3 00')\">".$first name."
".$lastname ."</A><BR>"
.$city.", ".$state." ".$country. "</FONT><BR></CENTER>";
}
echo "<HR><CENTE R>If you are already listed above,
congratulations !<BR>
If needed, you may edit your listing using the link at
left.</CENTER>";
mysql_free_resu lt($result);
}
Thanx,
Wm
getting only the most recent entry, repeated 4 times. What am I doing wrong
here?
$query="SELECT artistID,email, city,state,coun try from artists WHERE
email='$email'" ;
$result=mysql_q uery($query) or die(mysql_error ("Could not execute
query."));
if (mysql_num_rows ($result) > 0){
$alreadylisted = "1";
echo "<CENTER>$e mail is already in our database. Are you listed
below?</CENTER><BR>";
while($row = mysql_fetch_arr ay($result)) {
$artistID = $row['artistID'];
$email = $row['email'];
$city = $row['city'];
$state = $row['state'];
$country = $row['country'];
echo "<CENTER><HR><F ONT size=\"2\" face=\"Arial, Helvetica,
sans-serif\">
<A HREF=\"javascri pt:;\"
onClick=\"openP rofile('artist. php?artistID=". $artistID.
"','Artist','re sizable=yes,wid th=600,height=3 00')\">".$first name."
".$lastname ."</A><BR>"
.$city.", ".$state." ".$country. "</FONT><BR></CENTER>";
}
echo "<HR><CENTE R>If you are already listed above,
congratulations !<BR>
If needed, you may edit your listing using the link at
left.</CENTER>";
mysql_free_resu lt($result);
}
Thanx,
Wm
Comment