On 31 Mar 2002, at 17:34, Alex Behrens wrote: > My statement is this and it still gives me an error and wont add the data, > the addslashes doesn't seem to be working: > > $sql = addslashes("INSERT INTO hwureviews > (name,title,picurl,url,author,email,category,num,info) VALUES > ('$name','$title','$picurl','$url','$author','$email','$category','$num','$i > nfo')");
I imagine addslashes() is working fine. It's just not doing what you think it should. The addslashes() function isn't magical -- it doesn't know that you want the single quotes inside $name backslashed but not the ones around it. You have to apply addslashes() to your individual values, not to the whole SQL statement. -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php