Solved

MySQL Update question

Posted on 2011-09-10
9
313 Views
Last Modified: 2012-05-12
UPDATE `URL` SET `Column`=1 WHERE `Top Level Category`='Cat1'
AND  `Page Category`='Cat2' AND  `Group Category`='Cat3'

Open in new window

Can you fix this MySQL statement? I need it to work in PHPMyAdmin.
0
Comment
Question by:phat_code
9 Comments
 
LVL 30

Expert Comment

by:hnasr
Comment Utility
What warnings are you getting?

Is the value 1 or '1'?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
There nothing wrong with your SQL unless it doesn't match your table.  @hnasr is asking whether it should be the number 1 (without quotes) or the character '1' (with quotes).
0
 

Author Comment

by:phat_code
Comment Utility
its number 1
0
 

Accepted Solution

by:
phat_code earned 0 total points
Comment Utility
UPDATE  `URL`
SET `Column`=1 
WHERE  `Top Level Category` LIKE  'cat1'
AND  `Page Category` LIKE  'cat2'
AND  `Group Category` LIKE  'cat3'

Open in new window

Fixed it.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Closing Comment

by:phat_code
Comment Utility
Found the Answer.
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
@phat_code: that doesn't make much sense as LIKE 'literal w/o wildcard' acts the same as = 'literal w/o wildcard'; therefore, it must be something with data types of the fields maybe? Not disputing the closure or that you solved this by the way. I am happy you figured it out. My concern is if you are going to leave this in the PAQ, it would be great for future readers to truly understand the solution, i.e., if using TEXT columns use ... or something to that effect.
0
 

Author Comment

by:phat_code
Comment Utility
Not sure what you mean Text columns? And who do I give the points too also why didn't it work with equal signs?
0
 

Author Comment

by:phat_code
Comment Utility
I am using PHP MyADMIN maybe thats the problem???????????????
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
You give the points to your own comment as you did to answer the "who do I gives to" question. What I meant by TEXT columns is what is the data type of the columns `Top Level Category`, `Page Category`, `Group Category`. It may have to do with their type. I threw out TEXT as an example. If you don't know, then that is fine. I was just making the point that "why didn't it work with equal signs?" isn't clear from the information in the question. Not an issue for you really, so again no worries if you don't know.

Regards, Kevin
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MySQL Error 3 34
MySQL database data submission 7 38
2 Access tables, count verbiage used 6 19
PHP loop not working 4 29
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now