I've been using php to search through sales orders in a mysql database. Its been working really well until recently when I added data for about 300 old orders by importing the records from a csv file. Now when I execute the search only the original data is included in the results, it's as if the new data isnt being recognized or it's being skipped over.
I used phpmyadmin to import. I'm new to php/mysql, any suggestions are appreciated. Thanks - Mike
lets see the fields, and search for a field which has different format.
There might be a field which has a UNIQUE property.
Date format, a field that you did not fill correctly, for example an EVAL ('Y,'N' )type.
id int(10) No auto_increment product varchar(200) latin1_swedish_ci Yes NULL advert varchar(50) latin1_swedish_ci Yes 0 catalog varchar(40) latin1_swedish_ci Yes NULL contact varchar(40) latin1_swedish_ci Yes NULL campaign int(10) Yes NULL source varchar(50) latin1_swedish_ci No date date Yes NULL
Sorry for the copy/paste formatting.
this is not a table structure dump.
but your id field is not auto increment, so that might be youre problem.
before you insert, you must select the biggest value, and set that.
So I changed the script to search through a different field and in doing so I found that I can search and get results for numbers but not words or phrases. So for example I have two records, one for "product x" and one for "product x2" a search for 'product x" returns no results while a search for "2" will return the "product x2" record.
Does that even make sense? I feel like I've overlooked something or I dont have an understanding of some basic fundamental concept and it's messing everything up.
Ok so I kept digging and now realize that when I import the data from the csv file I get these little 's ("& #129;") between every character.
Not sure what I'm doing wrong.
Got it. What I was doing wrong:
I edited the csv file in wordpad and "saved as" before importing. Not sure why but it f-ed up the data and made it unreadable. I used phpmyadmin to skip the lines I wanted to edit out and imported. Works fine now.