[SOLVED] Insert new row without knowing number of columns??

This is a discussion on "[SOLVED] Insert new row without knowing number of columns??" within the Databases section. This forum, and the thread "[SOLVED] Insert new row without knowing number of columns?? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 27th, 2007, 03:33
SuperMember

SuperMember
Join Date: Apr 2007
Location: Sydney
Posts: 156
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Insert new row without knowing number of columns??

Hi all,

Can I create a new row without knowing the number of columns? The only way I know to insert a new row is:

Code: Select all
INSERT INTO table VALUES('','','','','','')etc..
But this throws an error unless you know the exact number of columns,

Cheers,

Nate.
Reply With Quote

  #2 (permalink)  
Old Dec 27th, 2007, 03:46
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Insert new row without knowing number of columns??

Yeah, if you know what columns you want to add to you can use.

Code: Select all
INSERT INTO table (Column1, Column2, Column3) VALUES('','','')
This will insert only the columns you specify and leave the remaining columns at their default value.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
  #3 (permalink)  
Old Dec 27th, 2007, 03:51
SuperMember

SuperMember
Join Date: Apr 2007
Location: Sydney
Posts: 156
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Insert new row without knowing number of columns??

Ah, excellent.. Thankyou!
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[solved] I want to insert a line break minute44 PHP Forum 4 Feb 20th, 2008 12:52
[SOLVED] IE6 is not rendering my columns correctly Oak Web Page Design 26 Jan 13th, 2008 22:12
[SOLVED] 3 columns? PicoDeath Web Page Design 31 Dec 8th, 2007 20:33
[SOLVED] IP Number Stormraven Webforumz Cafe 2 Nov 10th, 2007 20:30
[SOLVED] Help with guess a number program alesv JavaScript Forum 2 Oct 14th, 2007 14:51


All times are GMT. The time now is 07:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43