Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

MYSQL issue

  • 13-08-2008 12:57pm
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    hi

    im doing a select form a db table asking for all the entries that start with L:

    select * FROM #__model AS m LEFT JOIN
    #__mb_link AS mb ON (mb.modelid=m.id)
    WHERE mb.productid=4500 AND m.modelbrand>0 AND (m.modeltitle LIKE 'L%' OR m.modeltitle LIKE ' L%') ORDER BY m.modeltitle

    however it does not bring them all back

    i then go and look into the table and see that there seems to be a space before alot of the titles

    see attachment

    however whenever i go to edit the entry that seems to have the space , it does not have a space! - when i save/update it, it seems to get sorted


    anyone know whats wrong here- and how i may ajust my select so as it pulls back all entries starting with L
    ?

    tnx


Comments

  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    Off the top of my head, run an update on that column that does an LTRIM to get rid of any leading spaces.

    HTML will only display one space (unless the text is in a <pre> tag, or   is used), so that could be why it's not displaying in the UI.


  • Registered Users, Registered Users 2 Posts: 7,521 ✭✭✭jmcc


    hi
    however whenever i go to edit the entry that seems to have the space , it does not have a space! - when i save/update it, it seems to get sorted


    anyone know whats wrong here- and how i may ajust my select so as it pulls back all entries starting with L?
    MySQL has a trim function to remove spaces but the problem could lie in the schema. Is the field with the number defined purely as an int or is it a varchar?

    Regards...jmcc


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    jmcc wrote: »
    MySQL has a trim function to remove spaces but the problem could lie in the schema. Is the field with the number defined purely as an int or is it a varchar?

    Regards...jmcc

    heres the table attached


    i did the trim on the table field - it changed about 30 but the majority of them remain the way they were.


    tnx


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    any ideas ?


Advertisement