On Fri, 23 Mar 2001, Johan Vikerskog (ECS) wrote:
> 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?
Got to http://www.php.net and on the top search entrybox, give the word: mail
You'll get the mail() function manual which is pretty descriptive.
> And question #2.
> Exactly what do the $row do?
Logically: $row holds a row from your result set. So you have to call
mysql_fetch_array() multiple times to iterrate through every row of the result set,
represented here by the $result handler that mysql_query() returned.
Physically: $row holds an associative array whose keys are the labels of the columns
of your result set.
regards,
thalis
---------------------------------------------------------------------
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