Question - I'm creating a dynamic query (using PHP)
but my question I think is more related to mysql
syntax.
Right now I have these statements:

<?php
$sql .= " SELECT PostStart, JobTitle, Industry,
LocationState, VendorID FROM VendorJobs";
        
if ($s_Ind){
$sql .= " WHERE VendorJobs.Industry IN ($s_Ind)";
}

if ($s_State){
$sql .= " AND VendorJobs.LocationState IN ($s_State)";
}

What I think I need is some kind of default "WHERE" in
the first statement.  Both Ind and State are
conditional based on whether the user input anything. 
Right now they would be forced to at least choose the
Ind.  So instead of the $s_Ind have a "WHERE" it
should be an "AND" .

??Any thoughts / ideas.

Thank you 
Stuart

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to