Having multiple values within an

前端 未结 3 490
Happy的楠姐
Happy的楠姐 2021-01-24 10:51

I am trying to create a dropdown box where it has from 10 - 90, I want each value to stand for the numbers in between (so 10 will hold 11, 12, 13, 14.. and so on and so forth).

3条回答
  •  感情败类
    2021-01-24 11:27

    The value of an can be any string; it's up to your server-side code to interpret that string appropriately.

    Rather than always using the string-match operator LIKE in your SQL, you need to choose appropriate conditions for each of your columns.

    For instance, set your value to be a range specified by min and max: and then use <= and >= in your SQL (beware of "fence-post errors"!)

    list($min,$max) = explode('-', $_POST['trayheight']);
    $sql .= 'And trayheight >= ' . intval($min) . ' And trayheight <= ' . intval($max);
    

提交回复
热议问题