Mysql queries and <a href...> links

software development

#1

I am trying to query my database to have a list of all person’s names show as a link to their website…ie person’s name

I am obviously doing something wrong as I am getting “Parse error: parse error, unexpected T_PRINT” error.
at the top of my page…

<?php mysql_select_db($database_memberlist, $memberlist); $query_member3 = "SELECT * FROM mysql_tbl WHERE paidflag > 0 AND paidflag < 999999 ORDER BY name ASC"; $member3 = mysql_query($query_member3, $memberlist) or die(mysql_error()); $row_member3 = mysql_fetch_assoc($member3); $totalRows_member3 = mysql_num_rows($member3); $results = mysql_query( "SELECT iname, website FROM mysql_tbl", $mysql_connection ); ?>

in my body’s table, I have

<?php do { ?> <?php echo $row_member3['name']; ?> <?php } while (($row_member3 = mysql_fetch_row($results)) print "$name";

while ($row_member3 = mysql_fetch_assoc(member3)); ?>

anyone know what I am doing wrong. I know so so little of php and mysql and my learning curve is slooooooow…can’t seem to finish reading the books! But will still keep trying!

tia
Barbara


#2
<?php mysql_select_db($database_memberlist, $memberlist); $query_member3 = "SELECT * FROM mysql_tbl WHERE paidflag > 0 AND paidflag < 999999 ORDER BY name ASC"; $member3 = mysql_query($query_member3, $memberlist) or die(mysql_error()); $totalRows_member3 = mysql_num_rows($member3); $results = mysql_query( "SELECT iname, website FROM mysql_tbl", $mysql_connection ); while (($row_member3 = mysql_fetch_assoc($results))){ ?> <?php echo $row_member3['name']; ?> <?php } ?>

#3

that about sums it up…thanks

I am a diot at this…but learning sloooowly.

barbara


#4

Though I wouldn’t use the target="_blank"; opening new browser windows is very annoying.

– Dan


#5

took a bit of tweaking, and thanks. I got it to work, here is the code…

<?php mysql_select_db($database_memberlist, $memberlist); $query_member3 = "SELECT * FROM mysql_tbl WHERE paidflag > 0 AND paidflag < 999999 ORDER BY name ASC"; $member3 = mysql_query($query_member3, $memberlist) or die(mysql_error()); $row_member3 = mysql_fetch_assoc($member3); $totalRows_member3 = mysql_num_rows($member3); ?> <?php do { ?> <?php echo $row_member3['name']; ?> <?php } while ($row_member3 = mysql_fetch_assoc($member3)); ?>