Jump to content

Recommended Posts

<?php

//Printer ut table taggen

print(\'<table width=\"500\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#000000\">\');

//Sender setningen mot database som skal hente ut infoen

$setning = @mysql_query(\"SELECT * FROM navn\");

//Bruker en loop for aa faa all informasjonen ut

while($adresser = @mysql_fetch_array($setning))

{

//Naa er informasjonen lagret i arrays

print(\"<tr>\");

print(\"<td width=\"500\" background=\"meny.gif\" colspan=\"2\">$adresser[overskrift]</td>\");

print(\"<tr>\");

 

// here is the start of the link

 

print(\"<td bgcolor=\"#EAEAEA\" width=\"250\">Lagt til av: <a href=\"mailto:\" . $adresser[\"mail\"] . \"\">\" . $adresser[navn] . \"</a></td>\");

 

// here is the end of the link

 

print(\"<td bgcolor=\"#EAEAEA\" width=\"250\"></td>\");

print(\"</tr>n\");

print(\"<tr>\");

print(\"<td bgcolor=\"#FFFFFF\" colspan=\"2\" width=\"500\">$adresser[artikkel]</td>\");

print(\"</tr>n\");

}

//Slutter av tabellen

print(\'</table>\');

print(\'<br>\');

print(\'<br>\');

?>

 

This is the code for acessing the database and print the information out. But i want to show the mail adress that i sin the database, But with this code i cant see the link, anybody that can help me with how to get the link to work correctly?

Link to comment
https://forums.phpfreaks.com/topic/824-getting-data-out-of-mysql-database/
Share on other sites

Try it with quotes around \"navn\"

 

[php:1:5a0db61e95]<?php

print(\"<td bgcolor=\"#EAEAEA\" width=\"250\">Lagt til av: <a href=\"mailto:\" . $adresser[\"mail\"] . \"\">\" . $adresser[\"navn\"] . \"</a></td>\");

 

 

 

?>[/php:1:5a0db61e95]

 

hth

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.