4images Modifications / Modifikationen > Tutorials

[Tutorial] Making additional field searchable

<< < (3/15) > >>

bernd:
to be able to use it just like the keywords? I did the MODs so I have the photographer being shown below the image and I can search for this via the extended search but I'd like my users to be able to just click the photographer's name and they are then shown all pictures taken by this guy.

I tried to find how/where it is done for the keywords but I struggled ...

Thanks in advance!
Bernd

Psy:
I'm having problems with making these fields searchable

I used the Mod to add extra fields ( 7 extra fields in total ) which worked fine...all the new fields dumped into the db fine and displayed fine.

Next, I followed this Mod to make these new fields searchable, and ran the rebuild search index tool,
witch gave me this error:


--- Code: ---Processing image qqqqq, ID 9 ... OK
Processing image can, ID 10 ...
DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match, edibility_match, habitat_match, range_match, season_match, sporecolor_match, mushroomshape_match, lookalikes_match) VALUES (10, 7, 0, 1, 1, 0), (10, 10, 0, 0, 1, 0)
Column count doesn't match value count at row 1
OK
Processing image asasas, ID 11 ...
DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match, edibility_match, habitat_match, range_match, season_match, sporecolor_match, mushroomshape_match, lookalikes_match) VALUES (11, 12, 0, 0, 0, 0), (11, 13, 0, 0, 0, 0), (11, 14, 0, 0, 0, 0), (11, 15, 0, 0, 0, 0)
Column count doesn't match value count at row 1
OK


Search index rebuilt!
--- End code ---





I them tried search my new fields, and found that I can search the first extra field I added, get a error when I try to search the rest of the new fields:

--- Code: --- DB Error: Bad SQL Query: SELECT m.image_id FROM 4images_wordlist w, 4images_wordmatch m WHERE w.word_text LIKE 'rust' AND m.word_id = w.word_id AND m.sporecolor_match = 1
Unknown column 'm.sporecolor_match' in 'where clause'
--- End code ---



I them tried to upload a new image, and got this error:

--- Code: --- DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match, edibility_match, habitat_match, range_match, season_match, sporecolor_match, mushroomshape_match, lookalikes_match) VALUES (12, 5, 0, 0, 0, 1), (12, 12, 0, 0, 0, 0), (12, 13, 0, 0, 0, 0), (12, 14, 0, 0, 0, 0), (12, 15, 0, 0, 0, 0)
Column count doesn't match value count at row 1
--- End code ---



Can anyone tell me what I'm doing wrong? I understand that this error comes from adding different amount
of values in than there are columns, but I can't see where my error is....any ideas????

--- Code: ---
--- End code ---

--- Quote ---
--- End quote ---
[/list:u]

Chris:
"Column count doesn't match value count at row 1"

It looks to me like you have a mismatch in the number of fields you added to includes/db_field_definitions.php and the number of new database columns you created.  Recheck these.  Either that or you have a mismatch of the types.  IE:  You added a character field and an integer field in the php file but added an integer and then character column in the database table.

Psy:
Chris - thanks for the quick reply

I've checked everything over 100 time and I still can't see anything wrong. What really gets me is that the first search field I added still works fine, but the rest don't.  :x  :x  :x  :x  :x  :x
Anyone have any other ideas???????? Plaese :cry:

V@no:
I didnt follow the discussion here :? but, just a thought:

--- Quote ---DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (1 image_id, 2 word_id, 3 name_match, 4 desc_match, 5 keys_match, 6 edibility_match, 7 habitat_match, 8 range_match, 9 season_match, 10 sporecolor_match, 11 mushroomshape_match, 12 lookalikes_match) VALUES 1 (12, 5, 0, 0, 0, 1), 2 (12, 12, 0, 0, 0, 0), 3 (12, 13, 0, 0, 0, 0), 4 (12, 14, 0, 0, 0, 0), 5 (12, 15, 0, 0, 0, 0)
Column count doesn't match value count at row 1
--- End quote ---

colored numbers are just count how many fields u are tryin  to update, and how many values. so, I'd say that the mismatch: 12 fields, but only 5 of them set values.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version