| | |
Question about inserts
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 60
Reputation:
Solved Threads: 4
I am writing from the ground up a feature for this one company in Georgia while I am in school. It is running on mysql, but I have encountered a problem (actually a few problems, which led to this problem). I use auto increment for the unique identifiers for each of my tables. Now when I insert into a table, all the examples of inserts tell me to type out all of my column names. This would not bother me so much if I could use stored procedures (my boss does not feel they are enterprise ready yet, and I would have to say that I agree with him). Since I cannot use stored procedures, I am writing the scripts in php in an include file and have php query the database, not a stored procedure. In terms of securing the data model (which I would have to say I am very proud of), this is not a good idea. Should anyone get a hold of the php code, they could easily figure out my entire data model, just not the primary keys.
Is there a way to insert into a table while skipping over a particular column without having to type out all the column names? For instance:
Any help would be appreciated.
Is there a way to insert into a table while skipping over a particular column without having to type out all the column names? For instance:
MySQL Syntax (Toggle Plain Text)
INSERT INTO table1 VALUES (id, info1, info2, info3); /* indiscriminate insert */ INSERT INTO table1 (column2, column3, column4) VALUES (info1, info2, info3); /* insert I have now */ INSERT INTO table1 (all but column1) VALUES (info1, info2, info3); /* insert I want */
Any help would be appreciated.
![]() |
Similar Threads
- C command-line I/O question (C++)
- Apache Alias Directive... mod_alias question (Linux Servers and Apache)
- Completely new to C++ and have question about using char (C++)
- Question (Geeks' Lounge)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the MySQL Forum
- Previous Thread: HELP! MySQL with phpMyAdmin 2.5.5-p\1
- Next Thread: Query Cache
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm data database design developer development distinct drupal dui ec2 email enter enterprise eudora facebook form foss gartner gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opensource oracle php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency





