Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

How to put articles into mysql database

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

How to put articles into mysql database

Postby inoob » 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.
inoob
New php-forum User
New php-forum User
 
Posts: 31
Joined: Tue Nov 06, 2012 12:20 pm

Re: How to put articles into mysql database

Postby kiash001 » 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\">
User avatar
kiash001
New php-forum User
New php-forum User
 
Posts: 16
Joined: Wed Feb 27, 2013 2:49 am
Location: Dhaka, Bangladesh

Re: How to put articles into mysql database

Postby inoob » 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?
inoob
New php-forum User
New php-forum User
 
Posts: 31
Joined: Tue Nov 06, 2012 12:20 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.