Insert problem

Results 1 to 2 of 2

Thread: Insert problem

  1. #1
    Join Date
    Dec 1969

    Default Insert problem

    Is the follow possible, this code doesn&#039;t work Can you use a WHERE statement in an INSERT INTO? <BR><BR>"INSERT INTO products (title,category,price,description) WHERE id=&#039;"&id&"&#039;"<BR><BR>Any help would be great!<BR>-susan

  2. #2
    Join Date
    Dec 1969

    Default Nope...

    You can not use where in an insert clause, insert adds a new record to a database, therefore, there is nothing to compare it to. You can use where with an update clause if you want. Also, in your sql statement, you must specify values for all of the fields you want to insert. Like this:<BR><BR>insert into products(title, category, price, description) values(&#039;Susan&#039;, &#039;IsUpTooEarly&#039;, &#039;4.99&#039;, &#039;if she is in the U.S.)<BR><BR>hope that helps some

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts