Jump to content

I have a form but am i setting my mysql table correctly?


usman07

Recommended Posts

I would suggest you create a varchar field and perhaps insert something like "1-5" where 1 is your minimum value and 5 is your maximum. You can then explode this value at the "-" and do whatever you want with the values. Alternatively, you could just create two fields, one called maximum and one called minimum or something more descriptive.

Surely the table is designed to hold properties. Properties have a set number of bedrooms, so the table structure you have is correct.

 

You would then need to select properties that fall into your min max range within your query. eg;

 

SELECT * FROM properties WHERE number_of_bedrooms >= $min and number_of_bedrooms <= $max

 

Also, fix your filed names so that they don't contain spaces.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.