Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I've understood your question, when the <code>form</code> is submitted, you want to <code>query</code> the database with the selected values.</p> <p><strong>Example using <code>AND</code>:</strong></p> <pre><code>// Prepare the Query $query = sprintf( "SELECT * FROM parts WHERE part='%s' AND make='%s' AND model='%s'", mysql_real_escape_string($_POST['drop1']), mysql_real_escape_string($_POST['drop2']), mysql_real_escape_string($_POST['drop3']) ); // Execute the Query mysql_query($query); </code></pre> <p><em>This will select all rows from the table parts that match those three values.</em></p> <p><strong>Example using <code>OR</code>:</strong></p> <pre><code>// Prepare the Query $query = sprintf( "SELECT * FROM parts WHERE part='%s' OR make='%s' OR model='%s'", mysql_real_escape_string($_POST['drop1']), mysql_real_escape_string($_POST['drop2']), mysql_real_escape_string($_POST['drop3']) ); // Execute the Query mysql_query($query); </code></pre> <p><em>This will select all rows from the table parts that match any of those three values.</em></p> <p><strong>You can read more about this:</strong></p> <p><a href="http://php.net/manual/en/function.mysql-query.php" rel="nofollow">mysql_query</a></p> <p><a href="http://php.net/manual/en/function.mysql-real-escape-string.php" rel="nofollow">mysql_real_escape_string</a></p> <p><a href="http://dev.mysql.com/doc/refman/5.6/en/index.html" rel="nofollow">MySQL 5.6 Reference Manual</a> :: <a href="http://dev.mysql.com/doc/refman/5.6/en/functions.html" rel="nofollow">12 Functions and Operators</a> :: <a href="http://dev.mysql.com/doc/refman/5.6/en/non-typed-operators.html" rel="nofollow">12.3 Operators</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload