Re: fetch then put record?

From: Date: Tue, 10 Jun 2003 02:21:52 +0000
Subject: Re: fetch then put record?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150838@lists.php.net to get a copy of this message
[reply to a personal email posted here for the benefit of all :)]
Are you sure you can't?
Yes.
Could ASP do something that MySQL/SQL can't?
You confusing apples and oranges ... ASP is not a database. You should be comparing ASP to PHP. So the short answer is PHP does not have an equivalent function to ASP's update() or whatever it is.
That is very strange.
No it isn't. These are different languages.
I wonder what mode ASP is accessing DB which lets you set record variables then paste them into
it?
A very bad mode I would think. Very dangerous. But I can see how it is convenient.
Perhaps it just does an update in the background.
Of course. No you understand. ASP is using a convenience method that does all that ugly SQL updating in the background. As far as I know PHP does not have such functionality.
This bugs me because my db has 125 fields and it will be a very long sql string!
I bet!
The form page generates form contents by using a while loop. How would you build the sql string from the form page?
Use a while loop ;) Name the GET or POST vars the same as the field names in the DB. Then you could use something like (I say like b/c this won't work, it's just an idea): $sql = "update table A SET "; while (list($fieldName, $value) == each($_POST)) { $sql .= " $fieldName='$value', "; } This won't work because there will be POST values passes in that are not part of your form data. Oh, and there will be a trailing "," you need to trim off ... Just a quick idea. -- Jean-Christian Imbeault

« previous php.general (#150838) next »