php - give page user control over where condition -
hi im new php , have little knowledge, in statement have status='a' , z.zoneid=1, there way give page user control on z.zoneid=1 can change zoneid available, maybe through drop-down list?
////////query & data display here///////// $q=mysql_query("select r.*, f.functionname, m.managername, z.zonename requests r inner join functions f on r.functionid = f.functionid inner join managers m on r.managerid = m.managerid inner join zones z on r.zoneid = z.zoneid status='a' , z.zoneid=1 order functionname"); echo "<table> <tr> <th>function</th> <th>manager</th> </tr>" ; while($nt=mysql_fetch_array($q)){ echo"<b>zone: $nt[zonename]<br>capacity: $nt[zonecapacity]</b><br><br>"; echo "<tr><td>$nt[functionname]</td><td>$nt[managername]</td></tr>"; } echo "</table>"; /////////////////////////////////////
this can out...
if( isset($_post['zoneid']) ){ $zoneid = $_post['zoneid']; //your code or processing here. } $q=mysql_query("select r.*, f.functionname, m.managername, z.zonename requests r inner join functions f on r.functionid = f.functionid inner join managers m on r.managerid = m.managerid inner join zones z on r.zoneid = z.zoneid status='a' , z.zoneid=1 order functionname"); echo "<table> <tr> <th>function</th> <th>manager</th> </tr>" ; // here create form echo "<form method='post' >"; echo "<search zoneid: <input type='number' name='zoneid' /><br>"; echo "<input type='submit' value='search' />"; echo "</form>"; while($nt=mysql_fetch_array($q)){ echo"<b>zone: ".$nt['zonename']."<br>capacity: ".$nt['zonecapacity']."</b><br><br>"; echo "<tr><td>$nt[functionname]</td><td>$nt[managername]</td></tr>"; } echo "</table>"; ?>
Comments
Post a Comment