Hello to all.

I am a relative newcomer to PHP. I am trying to pass the value of a variable from a 
MySQL database from one PHP page to another PHP page. On the first page, I've made 
the connection to the database, and the query works just fine, displaying the correct 
values from the $myrow fields.

This is the code to that point:

$db = mysql_connect("ip address here","user here","password here") or die ("Unable to 
connect to SQL server");
$result= mysql_query("SELECT * FROM databasename WHERE ID<20",$db);
while ($myrow = mysql_fetch_row($result)){
        <td>'. $myrow[0].'</td>
        <td>'. $myrow[1].'</td>
        <td>'. $myrow[2].'</td>

This works just fine. Then I try to pass the variable $myrow[0] to a second page, 
the value of the variable (a string that contains a name) is supposed to appear. 
the line of code:

<td><a href="email.php?recip=$myrow[0]"><img src="graphics/mail.gif" class="imglink" 
alt="Click to send mail to this person" /></a></td></tr>';

The page receiving this variable, email.php, uses this to retrieve the value of 

Send e-mail to <?php $recip=$_GET['recip']; echo "$recip"; ?>

However, all this manages to do is to print out this:

Send e-mail to $myrow[0]

Instead of the VALUE contained in the variable!

What am I doing wrong?

TIA --- Phil Matt

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to