Please HELP! SQL Nigtmare

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ppwalks
Forum Newbie
Posts: 1
Joined: Wed Feb 09, 2011 7:30 am

Please HELP! SQL Nigtmare

Post by ppwalks »

Hello,
I am new to php programming and one obstacle has got me stuck now for several days and driving me insain, please if someone could point me in the right direction i would be ever so grateful. As part of a project at college I have been given an assignment to post data to sql database and then retrieve all the fields and output them to page, all is well up to now.

i have made the form which successfully submits data to sql and i have been able to the echo the appropraite variables back to page. The problem I have is when I submit the form it sends all fields, if I wanted to only change 2 fields then it would overwrite the whole thing then display the 2 fields inserted only, i want it to display the data before the new row has NULL atributes in them. Please can somebody help!

Thankyou

Paul
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Please HELP! SQL Nigtmare

Post by VladSun »

You should check whether the record ID exists or not. A "save" method is either an "update" or "add" method depending on the record ID existence.

Google for "PHP CRUD".
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply