Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by 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

-
- Posts: 21
- Joined: Tue Nov 06, 2012 12:20 pm
by 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\">
-

kiash001
- New php-forum User

-
- Posts: 16
- Joined: Wed Feb 27, 2013 2:49 am
- Location: Dhaka, Bangladesh
-
by 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

-
- Posts: 21
- Joined: Tue Nov 06, 2012 12:20 pm
Return to PHP coding => General
Who is online
Users browsing this forum: No registered users and 4 guests