No, but SQL is your friend, and is actually easier than messing around with
recordsets, once you get the hang of it.
The exact form of your INSERT statement will depend a bit on the database
are you using, but the following is typical. This is MySQL syntax, I
believe PostgresSQL is similar.
INSERT INTO tablename ( firstname, lastname, phone_number) VALUES (
'$strFirst', '$strLast', '$strPhoneNo' )
and if you are truly confident and believe your table structure will NEVER
change, you could shorten it to
INSERT tablename VALUES ( '$strFirst', '$strLast', '$strPhoneNo' )
Sometimes you just UPDATE
UPDATE tablename SET firstname = '$strFirst', lastname = '$strLast',
phone_number = '$strPhoneNo' WHERE primary_key_field = '$UniqueID'
If any rows are returned by a SELECT statement determines whether you use
an INSERT or an UPDATE, but then you have to do that to determine whether
you .AddNew or .Edit.
Hope this helps - Miles Thompson
PS Of course _nothing_ beats the ease of use and clarity of FoxPro and its
descendants. g
At 11:00 PM 11/20/2001 +0100, Daniel Schwab wrote:
Hi
I came from ASP and I'm sort of a newbie. I'm sure you'll see
that after my question :-)
I'm looking for a way to insert data in an mysql db but not with an
insert into statement. Is there any way i can do some sort of:
mydb.myfieldname = $myvalue
??
(same as in asp with recordsets: rs!fieldname = value)
any way to do that in a similar manner?
thanks for your help
daniel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]