dbTalk Databases Forums  

INSERT record like FETCH_ASSOC?

comp.databases.mysql comp.databases.mysql


Discuss INSERT record like FETCH_ASSOC? in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mike
 
Posts: n/a

Default INSERT record like FETCH_ASSOC? - 09-16-2011 , 08:07 AM






I need a way to insert a "registered" user's information in a database
by field name? Like fetch _assoc does for retrieving. I add fields and
using _query method - I need to know the orer of the fields. I want to
insert by knowing field names but not order.

Thanks,
Mike

Reply With Quote
  #2  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-16-2011 , 10:06 AM






On 9/16/2011 9:07 AM, Mike wrote:
Quote:
I need a way to insert a "registered" user's information in a database
by field name? Like fetch _assoc does for retrieving. I add fields and
using _query method - I need to know the orer of the fields. I want to
insert by knowing field names but not order.

Thanks,
Mike
http://dev.mysql.com/doc/

Look at the doc for the version you're using and see the INSERT statement.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #3  
Old   
Mike
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-16-2011 , 03:54 PM



On Fri, 16 Sep 2011 09:07:20 -0400, Mike <no_please (AT) not (DOT) com> wrote:

Quote:
I need a way to insert a "registered" user's information in a database
by field name? Like fetch _assoc does for retrieving. I add fields and
using _query method - I need to know the orer of the fields. I want to
insert by knowing field names but not order.

Thanks,
Mike

My version is 5.0.92-community. Which manual would I download?
Thanks
Mike

Reply With Quote
  #4  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-16-2011 , 06:13 PM



On 9/16/2011 4:54 PM, Mike wrote:
Quote:
On Fri, 16 Sep 2011 09:07:20 -0400, Mike<no_please (AT) not (DOT) com> wrote:

I need a way to insert a "registered" user's information in a database
by field name? Like fetch _assoc does for retrieving. I add fields and
using _query method - I need to know the orer of the fields. I want to
insert by knowing field names but not order.

Thanks,
Mike


My version is 5.0.92-community. Which manual would I download?
Thanks
Mike
Did you look at what's available?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #5  
Old   
Erick T. Barkhuis
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-17-2011 , 02:24 AM



Mike:

Quote:
On Fri, 16 Sep 2011 09:07:20 -0400, Mike <no_please (AT) not (DOT) com> wrote:

I need a way to insert a "registered" user's information in a
database by field name? ... I want to insert by knowing field
names but not order.


My version is 5.0.92-community. Which manual would I download?
Hi Mike,
You would probably want the INSERT...SET...-syntax
http://dev.mysql.com/doc/refman/5.0/en/insert.html


--
Erick

Reply With Quote
  #6  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-17-2011 , 06:14 AM



On 9/17/2011 3:24 AM, Erick T. Barkhuis wrote:
Quote:
Mike:

On Fri, 16 Sep 2011 09:07:20 -0400, Mike<no_please (AT) not (DOT) com> wrote:

I need a way to insert a "registered" user's information in a
database by field name? ... I want to insert by knowing field
names but not order.


My version is 5.0.92-community. Which manual would I download?

Hi Mike,
You would probably want the INSERT...SET...-syntax
http://dev.mysql.com/doc/refman/5.0/en/insert.html


Which is not standard SQL and not a good thing to use. You can do it
with standard SQL, though.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #7  
Old   
Luuk
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-17-2011 , 06:18 AM



On 17-09-2011 13:14, Jerry Stuckle wrote:
Quote:
On 9/17/2011 3:24 AM, Erick T. Barkhuis wrote:
Mike:

On Fri, 16 Sep 2011 09:07:20 -0400, Mike<no_please (AT) not (DOT) com> wrote:

I need a way to insert a "registered" user's information in a
database by field name? ... I want to insert by knowing field
names but not order.


My version is 5.0.92-community. Which manual would I download?

Hi Mike,
You would probably want the INSERT...SET...-syntax
http://dev.mysql.com/doc/refman/5.0/en/insert.html



Which is not standard SQL and not a good thing to use. You can do it
with standard SQL, though.

But, this being about MySQL..... why not do it the MySQL way?

--
Luuk

Reply With Quote
  #8  
Old   
Erick T. Barkhuis
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-17-2011 , 09:36 AM



Jerry Stuckle:

Quote:
On 9/17/2011 3:24 AM, Erick T. Barkhuis wrote:
Mike:

On Fri, 16 Sep 2011 09:07:20 -0400, Mike<no_please (AT) not (DOT) com
wrote:

I need a way to insert a "registered" user's information in a
database by field name? ... I want to insert by knowing field
names but not order.


My version is 5.0.92-community. Which manual would I download?

Hi Mike,
You would probably want the INSERT...SET...-syntax
http://dev.mysql.com/doc/refman/5.0/en/insert.html



Which is not standard SQL and not a good thing to use.
I like to use the good things MySql has to offer. This is one of them.

Quote:
You can do it with standard SQL, though.
....but you don't want to tell anyone how that works. You'd rather wait
for the thread to escalate, then throw in some valuable insults.

--
Erick
[Popcorn handy]

Reply With Quote
  #9  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-17-2011 , 10:23 AM



Erick T. Barkhuis wrote:
Quote:
Jerry Stuckle:

On 9/17/2011 3:24 AM, Erick T. Barkhuis wrote:
Mike:

On Fri, 16 Sep 2011 09:07:20 -0400, Mike<no_please (AT) not (DOT) com
wrote:

I need a way to insert a "registered" user's information in a
database by field name? ... I want to insert by knowing field
names but not order.

My version is 5.0.92-community. Which manual would I download?
Hi Mike,
You would probably want the INSERT...SET...-syntax
http://dev.mysql.com/doc/refman/5.0/en/insert.html


Which is not standard SQL and not a good thing to use.

I like to use the good things MySql has to offer. This is one of them.

You can do it with standard SQL, though.

...but you don't want to tell anyone how that works. You'd rather wait
for the thread to escalate, then throw in some valuable insults.

Natch. Jerry doesn't actually KNOW anything. Except how to turn on error
reporting and how to turn off people.

Reply With Quote
  #10  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: INSERT record like FETCH_ASSOC? - 09-17-2011 , 12:32 PM



On 9/17/2011 7:18 AM, Luuk wrote:
Quote:
On 17-09-2011 13:14, Jerry Stuckle wrote:
On 9/17/2011 3:24 AM, Erick T. Barkhuis wrote:
Mike:

On Fri, 16 Sep 2011 09:07:20 -0400, Mike<no_please (AT) not (DOT) com> wrote:

I need a way to insert a "registered" user's information in a
database by field name? ... I want to insert by knowing field
names but not order.


My version is 5.0.92-community. Which manual would I download?

Hi Mike,
You would probably want the INSERT...SET...-syntax
http://dev.mysql.com/doc/refman/5.0/en/insert.html



Which is not standard SQL and not a good thing to use. You can do it
with standard SQL, though.


But, this being about MySQL..... why not do it the MySQL way?

Because that's just one more thing you have to change if you start using
another database, i.e. PostGres, DB2, SQL Server...

And it's a good idea when there is a standardized means of doing
something to do it that way all the time - so you don't have to change
your way of thinking when you use a SQL standard database.

In the last 25 + years of RDBMS programming, I've found the closer you
stay to the standards the better off you end up begin.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.