Jump to content

store the link into datbase through csv file and fetch it as a link only??


deepson2

Recommended Posts

Hello all,

 

  I am storing data from csv file to database. For one of the column i am storing description and this description has a few links like this-

 

 

$string =
  " Lorem ipsum dolor
  sit amet,www.goggle.com.Aliquam
  pretium ullamcorper urna quis iaculis. Etiam ac massa
  sed turpis tempor luctus. Curabitur sed nibh eu elit
  mollis congue. Praesent ipsum diam, consectetur vitae
  ornare a, aliquam a nunc. In id magna pellentesque
  tellus posuere adipiscing. Sed non mi metus, at lacinia
  augue. Sed magna nisi,www.facebook.com,mollis
  sed nunc. Etiam at justo in leo congue mollis.
  Nullam in neque eget metus hendrerit scelerisque
  eu non enim. Ut malesuada lacus eu nulla bibendum
id euismod urna sodales. ";

 

 

So this description has two links goggle.com and facebook.com Now my questions are-

 

1) Can we store these links as links only into the database?

2) while selecting this row can i show the link as link only so user can click on this particular link and use it probably?

 

 

Thanks in advance

Use preg_match_all to get all the links, then loop the result to create the INSERT  query (however your db is structured), and voila, links in the db.

 

php.net is all im gunna say, regex help is in a sub forum.

 

good luck,

-cb-

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.