On Wed, 14 Nov 2001 04:26, Raymond wrote:
> Hi!
>
> I'm trying to send a mail with password to the new user of my website,
> but ......... Does anyone know how to put the variable inside my mail?
>
> I have tried this:
>
> ---------------------->
> else {
>
> // sende kundeopplysninger til databasen
>
>   $db = mysql_connect("localhost", "root");
>
>   mysql_select_db("subway",$db);
>
>   $sql = "INSERT INTO nettkunder
> (fornavn,etternavn,firma,adresse,postnr,sted,telefon,epost) VALUES
> ('$fornavn','$etternavn','$firma','$adresse','$postnr','$sted','$telefo
>n','$ epost')";
>
>   $result = mysql_query($sql);
>
>   echo "Velkommen som kunde hos Subway.\n";
>
> }
>
>   $db = mysql_connect("localhost", "root");
>
>   mysql_select_db("subway",$db);
>
>
> $id = mysql_query("GET id FROM nettkunder WHERE epost = '$epost'",$db);
>
> mail("$epost", "Velkommen som kunde hos Subway", "Her har du ditt
> passord: $myrow["id"] \n God appetitt! Hilsen Subway");

The value you are passing in $myrow["id"] doesn't exist in your code. You 
need to do 

$myrow = mysql_fetch_row($id);

after your mysql_query to populate the row data. And your query should 
probably read "SELECT id FROM...

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Washed the cat - took HOURS to get the hair off my tongue!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to