Products filtering options through mysqli_prepare

Don’t do this. No sql injection protection. And if you have string data and the strings have commas then bad things happen.

The resultant value is NOT being put directly into the sql query statement. It is being supplied as a prepared query input value when the previously prepared query gets executed.

Hi MabIsMad :slight_smile:

Can I ask u some little more help, please ? with regard to the code u wrote for me.
It works like a charm on single values saved in db, but not when an item has several properties in 1 column. Ex: When a dress is made of 2 main materials such as leather and mesh, or when its has various ‘attributes’ like studs, ruffles, beads and tassels, etc.

If I check the checkbox in order to show sequined products, only items featuring sequins as unique attribute are displayed, while those that embed sequins & tassels are not.

I’ve tried to think & search by myself how to solve that puzzle, but :slight_smile:

Many thanks for your great help & advices

Hopefully, you learnt from it, rather than to just copy/paste.

If that means you have stored a list of values in one column, don’t. It makes finding, inserting, updating, or deleting information harder.

You would need to post some examples showing what data you have stored for a product, how it is stored, and what the submitted form data looks like.

All babies even animals learn by copying/ pasting what they learnt from their teachers. Then they experience by themselves & see that beginners still have a lot to learn. so they ask or search the web for the most efficient techniques to meet their goals. ,
By chance, I’m self taught & quite comfortable in 10 programming languages […], but still learning…

I store only 1 value per column, but in what’s regarding occasions, attributes and materials, I can keep various criterias.
Occasions : that dress can be the masterpiece in various kinds of lifetime : cocktail / party / ceremony / or office, / or casual + beach + romantic …

Materials : Maybe the dress’s main material is silk, maybe the upper part is satin sequined and the lower one is made of leather :slight_smile: // Yeah u know girls & designers… Girls who know exactly what they’re looking for…

etc…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.