1:
print '<a
href="mailto:'.$row["email_player"].'">'$row["email_player"].'</a>';

2:
$row is the name of the array you have defined to hold the current row form
the resultset your created with the SELECT statement. each time you do $row
= mysql_fetch_array($result) it takes the next row from $result and stored
it in the array named $row.

Cal
http://www.calevans.com


-----Original Message-----
From: Johan Vikerskog (ECS) [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 23, 2001 9:03 AM
To: [EMAIL PROTECTED]
Subject: My script that uses mysql.


I am not sure if i should post it here but please do help my if you can.
The script is as follows:

----------------------------------------------------------------------------
----<html>
<body>

<?php

mysql_connect (localhost, username, password);

mysql_select_db (dbname);

if ($first_name == "")
{$first_name = '%';}

if ($email_player == "")
{$email_player = '%';}

$result = mysql_query ("SELECT * FROM tablename
                         WHERE first_name LIKE '$first_name%'
                         AND email_player LIKE '$email_player%'
                       ");

if ($row = mysql_fetch_array($result)) {

do {
  print $row["first_name"];
  print (" ");
  print $row["email_player"];
  print ("<p>");
} while($row = mysql_fetch_array($result));

} else {print "Sorry, no records were found!";}

?>

</body>
</html>


I basically have two questions.
If i want to make a "mailto" function to "print $row["email_player"];", how
do i do that?

And question #2.
Exactly what do the $row do?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to