Jump to content

Hyperlinks in MySQL


beginann

Recommended Posts

When I put this into my MySQL-database where I would like to have the link to a homepage:

a href="http://www.ninnisull.se" target="_blank">Ninnis Ull & Textil</a  (!!! I have excluded the start- and endtag to avoid it become a hyperlink!!!)

 

this returns:

http://www.textilgotland.net/"http://www.ninnisull.se//"

 

www.textilgotland.net is the homepage where the database is located and this is the php-code:

 

<?php


//Search everyone

           $query = "SELECT name, place, tel, email, homepage FROM verksamhet WHERE verksamhet LIKE '%tovat%' ORDER BY name";

                $result = mysql_query($query);

                              if(!$result){

                              echo "<div class=tabell1><table><tr><td>Frågan är fel ställd. MySQL rapporterar: " . mysql_error() ."</td></tr>";

                              echo "</table></div>";

                              }

                              else if ($result && mysql_num_rows($result) > 0)

                              {

                                echo "<div class=tabell1><table><tr>

                                <td><h5>Namn      </h5> </td>;                                                                     

                                <td><h5>Ort          </h5> </td>;                                                                     

                                <td><h5>Telefon    </h5> </td>;

                                 <td><h5>E-mail     </h5> </td>;

                                 <td><h5>Homepage </h5> </td></tr>"; 

                          while(false !== ($line = mysql_fetch_assoc($result)))

                          {

                          echo "<tr><td>" . $line["namn"] ."</td>

                          <td>" . $line["ort"] ."</td>

                         <td>" . $line["tel"] ."</td>

                         <td>" . $line["email"] ."</td>                                                                    

                          <td>" . $line["homepage"] ."</td></tr>"; 

                          }

                          echo "</table></div>";

                          } 

                      // Stänger anslutningen till vår databas

                      mysql_close($connection); 

?>

 

I don´t know how to get the URL right! Can anyone help please?!

A-B

 

Link to comment
https://forums.phpfreaks.com/topic/47364-hyperlinks-in-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.