Jump to content

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


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-

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.