PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
// Connect to your MySQL database
require "dbconnect.php";
// Select the data
$select = mysql_query( "SELECT `agency` FROM csv WHERE `agencytype` = 'something' GROUP BY `agency`") or die("SELECT Error: ".mysql_error());
?>
<select onChange="window.open(this.options[this.selectedIndex].value,'_top')">
<?
// Begin grabbing the rows from your database
while ($row = mysql_fetch_array($select)) {
?>
<option value="queryws.php?agency=<? echo $row['agency']; ?>">
<? echo $row['agency']; ?>
</option>
<?
}
?>
</select>
The best example I can find is as follows, but I can seem to wrap my head around it. Might just need some more coffee...
mysql_real_escape_string is just protecting your input. You will get the value that you are passing. You should never use the input without some filtering.