View Single Post
  #2 (permalink)  
Old 12-28-2007, 05:22 PM
LLFitness_Derek LLFitness_Derek is offline
WebProWorld Pro
 

Join Date: Nov 2004
Location: Davis, North Carolina
Posts: 198
LLFitness_Derek RepRank 0
Default Re: PHP & MySql if....

This post was a little confusing but after reading it several times I believe I can offer a solution. First I will repeat what you stated but a little clearer to make sure I am getting the picture.

Database [VEND_DATE]
Fields [Vend1, Vend2, Vend3, odate1, odate2, odate3]

You are updating VEND_DATE with the value $_GET['new_vend'] and $_GET['new_date'].

First I need to say you can not update a record based on this database structure. This table does not have a primary key used as an identifier. How do you identify the data that you are updating. How can you tell between data you have already entered and the data you are updating.

Would this database structure fit your purpose better:
Database [VEND_DATE]
Fields [Vend_id, Vend_name, Vend_date]

From here you can run your update query:
UPDATE VEND_DATE SET Vend_date='whatever_date' WHERE Vend_id='whatever_id'

Or a SELECT query such as:
SELECT Vend_date FROM VEND_DATE WHERE Vend_id='whatever_id'

Am I getting the picture? If not can you provide a little more information on what you are trying to do. Give a real world example to make things clearer.
Reply With Quote