Welcome Guest, Not a member yet? Register   Sign In
Need help with MySQL Data!
#1

[eluser]YellowShadow[/eluser]
Hey everyone!

I'm having some major problems with CodeIgniter and my database.

I have a table in my database setup with a bunch of rows. I use jQuery to populate select boxes based on the user input from the previous box.

After the 3rd select box, it displays a table with the information. Problem is, the value that gets populated into the 3rd select box is different than the value from the database...even though it gets it the database.

For example: Cat2 should be 1.8L 112 ENG -1974-79 - OPEL but inside my select box its 1.8L 112 ENG -1974-79 - OPEL. This causes an error to be thrown and the table isn't displayed.

I've been having this problem for days and I can't seem to figure it out. If anyone could help, that would be great! I have to get this out to a client ASAP.

Here is how the final query looks like:
Code:
SELECT * FROM (`ExpansionPlugKit`) WHERE `Cat1` = 'BUICK' AND `Cylinder` = '4 Cyl.' AND `Cat2` = '1.8L 112 ENG -1974-79 - OPEL'

Even running that query through the mysql command line says no rows found.

Thanks,
Dro Sarhadian
#2

[eluser]InsiteFX[/eluser]
So edit the database record and remove the extra space in it.
#3

[eluser]YellowShadow[/eluser]
[quote author="InsiteFX" date="1328747519"]So edit the database record and remove the extra space in it.
[/quote]

I could, but they're all like that and I have thousands of records in there.
#4

[eluser]InsiteFX[/eluser]
You also write a routine that would read each database record and check to see if there is duplicate spaces in the names.
#5

[eluser]CroNiX[/eluser]
This will replace everything in the field_name field that has 2 spaces with a single space. Be sure there isn't anything with a double space in the table that you need before running this...
Code:
UPDATE table_name SET field_name = REPLACE(field_name, '  ', ' ');




Theme © iAndrew 2016 - Forum software by © MyBB