How to put articles into mysql database

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
inoob
New php-forum User
New php-forum User
Posts: 31
Joined: Tue Nov 06, 2012 12:20 pm

Tue Feb 19, 2013 6:19 am

I am looking at websites and they seem to have articles placed in their databases with img and link formats.

I am wondering how to put articles with formatting (link to images, hyperlinks) into a mysql database for each article written. I heard something about SQL injections related to this issue as well?

thanks in advance.

User avatar
kiash001
New php-forum User
New php-forum User
Posts: 14
Joined: Wed Feb 27, 2013 2:49 am
Location: Dhaka, Bangladesh
Contact:

Wed Feb 27, 2013 3:32 am

Well! if you want to store image in database you need to encode it into base64 format. It returns image into text form. And if you want to store hyperlinks it is possible directly but need to do some formatting using addslashes(). It adds '/' character like this <a href=\"http:\/\/google.com\">

inoob
New php-forum User
New php-forum User
Posts: 31
Joined: Tue Nov 06, 2012 12:20 pm

Wed Feb 27, 2013 4:33 am

Can't I just copy and paste the HTML as TEXT into mysql instead and this solves the problem?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 2 guests