Solved

MYSQL single row issue

Posted on 2013-11-14
6
353 Views
Last Modified: 2013-11-14
I had a weird thing happen today that I've never came across. I have a table full of data. I could not pull  certain row and only that row

example:

SELECT * FROM my_table where user = 'test'

I couldn't pull that row trying ANY of the the fields IE: address = 'whataever' city = 'mycity' etc.

Once i manually updated the row and re-enterd the data i could pull it.

repair table didn't help. I'm not sure what would cause this and would like to know
0
Comment
Question by:loki0609
  • 2
  • 2
  • 2
6 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39649841
Since you have already fixed it and haven't posted any error messages, it's going to be hard to figure it out.  Nothing left to work with.
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 39649901
Sounds like some kind of special character may have been included in the value(s). Using "user like '%test%' " may have found it?

I've wasted substantial time before trying to find why something wasn't retrieving only to find the id was appended with a space character. Since then, it's something I've learnt to look for without wasting substantial time first...
0
 
LVL 2

Author Comment

by:loki0609
ID: 39650201
Thanks for the replies.

The table i fixed was a restore from another server. So i went to the old server and sure enough that same row is fubar'd.

I was able to retrieve it with like '%test%'

I tried right(columnname, 1) and the 1 and 2 position return nothing.

If you go into a program like sqlyog or phpmyadmin and go to the field to manually edit it you can normally see spaces when you enter the field. This one you enter the field to edit and hit delete after the last character and it still doesn't fix it. You have to write over the whole field

trim(field) = 'test' does not retrieve the field.

I'm not going to spend much more time on it but it would be nice to know why or find a way to show ALL characters even if they are special or something.

Thanks for the help all
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.

 
LVL 35

Accepted Solution

by:
Terry Woods earned 250 total points
ID: 39650214
Interesting problem! You could perhaps try exporting the query result (using "like '%test%'") as an SQL and see what it gives as output.
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 39650227
I'd go with Terry's suggestion.  Or export as CSV.
0
 
LVL 2

Author Comment

by:loki0609
ID: 39650366
Great suggestion guys. I exported it and guess what was lurking at the end.

\r\n
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL: Grouping results with JOIN 8 49
PHP code to display images from MySQL db on a webpage 1 79
MYSQL simple update statement 3 46
Insert data into database 2 35
Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 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

14 Experts available now in Live!

Get 1:1 Help Now