Jump to content

Archived

This topic is now archived and is closed to further replies.

jmaccs64

Cmd line mySQL query?

Recommended Posts

What would cause this from a cmd line mySQL query?
Here is the query...
[code]SELECT * FROM surpool06 WHERE surpool_week='2' ORDER BY surpool_team, surpool_username[/code]
In phpmysql there appears to be line breaks in some fields before it lists surpool_team?
And those are the fields that are messed up.... What could be causing this?

Thanks
[code]+------------+-----------------------+--------------+--------------+
| surpool_id | surpool_username      | surpool_team | surpool_week |
+------------+-----------------------+--------------+--------------+
|        172 | big daddy d          |
Bears      | 2            |
|        262 | dancsu17              |
Bengals    | 2            |
|        170 | big daddy d          |
Chargers  | 2            |
|        168 | big daddy d          |
Colts      | 2            |
|        169 | big daddy d          |
Colts      | 2            |
      | 2            |              |
      | 2            |              |
      | 2            |              |
      | 2            |              |
      | 2            |leman          |
      | 2            |ime            |
    | 2            |irter            |
    | 2            |npa24            |
    | 2            |Tate for Heisman |
    | 2            |tt81            |
    | 2            |os              |
    | 2            |r911            |
    | 2            |an              |
    | 2            |                |
    | 2            |lo              |
    | 2            |rtime            |
    | 2            |rtime            |
    | 2            |g1429            |
    | 2            |a64              |
[/code]

Share this post


Link to post
Share on other sites
Is the problem that the output looks wierd when you run the query from the CLI?

Share this post


Link to post
Share on other sites
Yes....And there are line breaks in the fields in phpmysql.

I think i have figured out why the form that was inserting data may have had a break in it....but now i would like to remove all line breaks from the database is that possible, and if so how?

Share this post


Link to post
Share on other sites
Shouldn't be to difficult to issue a REPLACE() and to strip CR/LFs.

Share this post


Link to post
Share on other sites
I figured it out here is what I did!

[code]UPDATE `myTable` SET myField = replace(myField,"\r","") ;[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.