View Single Post
Join Date: Oct 2006
Posts: 232
Reputation: Rhyan is an unknown quantity at this point 
Solved Threads: 24
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Duplicate entry '' for key 2

 
0
  #8
Nov 18th, 2008
No, you did not mention the ZEND.
However, this insert as you have typed it contains the variable names instead of variable values. Is this the php code or the result from the php echo command?

I am not 100% sure you need the table and field names surrounded by ' ', but, still if it works, maybe it is ok.
Why don't you try this code. It works fine for me in multiple pages, so I have it verified numerous times.

  1. $sql = 'INSERT INTO article_fields VALUES (NULL, \''.$new_text.'\', \''.$field_type.'\')';

I think that this code will be ok also for the zend framework.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
Reply With Quote