Jump to content


problem in inserting data

  • Please log in to reply
1 reply to this topic

#1 abdfahim

  • Members
  • PipPipPip
  • Abd Fahim
  • 535 posts

Posted 16 August 2006 - 09:57 AM

I have a database name "forum_t". When I try to insert data in the table "posts" of the database with code ..

[mysql_query("Insert into posts(`post`) values('$new_post')");

the code works. But if I use same query like

[mysql_query("Insert into posts(`post`) values('$new_post')");

The code does not work !! Most astonishing is I used
echo "$new_post";
before query and it shows exact value of "$new_post", which means variable $new_post get its value rightly. But failed to insert in table. What may be the reason.

#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 16 August 2006 - 03:58 PM

Not sure... thought I don't know why you have an extra open bracket.  See what mysql_error() says... perhaps this is a quoting issue?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users