Solved

MySQL Update question

Posted on 2011-09-10
9
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 36517261
What warnings are you getting?

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

Expert Comment

by:Dave Baldwin
ID: 36517277
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
ID: 36517347
its number 1
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Accepted Solution

by:
phat_code earned 0 total points
ID: 36517369
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
 

Author Closing Comment

by:phat_code
ID: 36541472
Found the Answer.
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 36517613
@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
ID: 36518851
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
ID: 36518860
I am using PHP MyADMIN maybe thats the problem???????????????
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 36519131
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mysql how to execute a commands file 5 33
SP result not being displayed 5 44
error in oracle form 11 28
Access Runtime Error '3070' 5 9
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
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…

730 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