473,499 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql UPDATE with out specifying the column names

2 New Member
A normal MySQL UPDATE is written:

UPDATE table SET user='Username', pass='Password' WHERE id='Userid'

I have about 150+ columns of data that need updated. Hoping for some shorthand. Is there a way to send the update with out labeling all the column names? For example:

UPDATE table SET 'Username', 'Password' WHERE id = 'Userid'

i know this can be done in a INSERT if you fill all columns using:

INSERT INTO table VALUES('Username', 'Password')

instead of:

INSERT INTO table(user, pass) VALUES ('Username', 'Password')
Aug 20 '10 #1
3 5000
mwasif
802 Recognized Expert Contributor
There is no shorthand for UPDATE unless you want to update the same value for all the rows in the table.
Aug 21 '10 #2
Reed Remington
2 New Member
what is the shorthand for updating the same value for all the rows in the table? Maybe this will work for me.
Aug 23 '10 #3
mwasif
802 Recognized Expert Contributor
UPDATE query with no WHERE clause will update all rows with the same value e.g.
Expand|Select|Wrap|Line Numbers
  1. UPDATE table SET state='NY'
But this is not going to work for you if you want to update different values for different rows.
Aug 24 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
17336
by: Martin Lucas-Smith | last post by:
Can anyone point me to a regular expression in PHP which could be used to check that a proposed (My)SQL database/table/column name is valid, i.e. shouldn't result in an SQL error when created? ...
0
3955
by: Jake Johnson | last post by:
I am using php and mysql and I want to show the column names. How do I go about doing this without hardcoding the headers in my php? Regards, Jake Johnson jake@plutoid.com ...
0
3091
by: Thomas Finninger | last post by:
i want to use mysql for logging perposes ... the database will be accessed by a third party product using ODBC the problem: i'll have to create some columns with special characters in the...
2
3381
by: Bart Van der Donck | last post by:
Hello, I am using MySQL 4.0. Say that I have a table named "mytable" having a column "ID" and a column "test columnname". When dumping: mysqldump --opt DATABASE -uUSER -hHOST -pPASS >...
2
12345
by: Matthew Cascio | last post by:
My understanding is that using reserved words as column names is allowable as long as they are quoted. I am trying to create a table dynamically with columns defined by the first row of a text...
0
1140
by: zacks | last post by:
I am trying to use the Microsoft Text Driver to access data in a text file via ODBC calls. Everything has worked fine so far. I am now trying to implement support for a file that has a special...
4
10258
by: natG | last post by:
Hi; I am transferring data from MySql to db2 using my own java/jdbc program. Working out ok, except for the fact that our apps use mixed-case names for tables and columns. Although my CREATE TABLE...
0
985
by: beautifulcarcass | last post by:
Hi, in this school project im making, im having a problem if i could display the column names from a table on a MYSQL database to a webpage through PHP with a loop is there a function to display...
3
12340
by: beautifulcarcass | last post by:
Hi, in this school project im making, im having a problem if i could display the column names from a table on a MYSQL database to a webpage through PHP with a loop is there a function to display...
3
3050
by: koti688 | last post by:
how to get the column names and the values of them in select statment. I have a packaze like this named ADB.pm package ADB; use DBI; @ISA = ('Exporter');
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.