List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 22 2003 2:02am
Subject:Re: Insert with addslashes
View as plain text  
At 20:43 -0500 5/21/03, Alex Behrens wrote:
>Hey All,
>
>Sorry for making multiple posts, but I need to get this problem resolved.
>I'm trying to be able to insert html code and text into a mysql db for use
>on a website. Below is my insert string:
>
>   $sql = "INSERT INTO hwu_articles (subject, date, author, author_email,
>main_body, forum_url, dealtime_name, dealtime_url, man_name, man_url, type,
>cost, cost_url, rating, id, page, page_subject, end) VALUES ('$subject',
>'$date', '$author', '$author_email', '$main_body', '$forum_url',
>'$dealtime_name', '$dealtime_url', '$man_name', '$man_url', '$type',
>'$cost', '$cost_url', '$rating', '$id', '$page', '$page_subject', '$end')";
>
>However, I'm having trouble when inserting a lot of HTML data that includes
>single and double quotes and I don't how knwo to make use of the add slashes
>function.
>
>How do I add this function to my syntax and is is possible to just add it to
>the "main_body" column, since this is the column with all the html coding.
>Thanks for your help!
>Right now my inserts dont work!

The easiest thing might be to insert this statement immediately prior
to your statement above:

$main_body = addslashes ($main_body);

>
>Thanks!
>--------------------------------------------
>-Alex "Big Al" Behrens
>E-mail: bigal@stripped
>Urgent E-mail: bigal-cell@stripped (Please be brief!)
>Phone: 651-482-8779
>Cell: 651-329-4187
>Fax: 651-482-1391
>ICQ: 3969599
>Owner of the 3D-Unlimited Network:
>http://www.3d-unlimited.com
>Send News:
>news@stripped


-- 
Paul DuBois
http://www.kitebird.com/
sql, query
Thread
Insert with addslashesAlex Behrens22 May
  • Re: Insert with addslashesPaul DuBois22 May
  • RE: Insert with addslashesDon Read22 May