Forum Moderators: coopster
I was hoping something like this would work:
// get contact id
$rate = $_GET['rate'];
if (!empty($rate)) { $_SESSION['recordrate']=$rate; }
else { $rate = $_SESSION['recordrate']; }
$query = "SELECT * FROM table WHERE rate='$rate'";
$result = $database->query($query);
$dex = $result->fetchRow(DB_FETCHMODE_ASSOC,0);
$database->disconnect();
But I can't seem to find a way. Anybody have any ideas on how to do this? If it makes since.
Also, you have not connected to a db from what I can see. You might want to take a look at the following thread to see how to do that: [webmasterworld.com...]
Other than that, though, you have the general idea. Just note, that you should be escaping the $rate variable before you use it within the query, and also checking to see if it is an integer, just so that your application doesn't fail because of incorrect input or a malicious attempt to hack your db. Look at mysql_real_escape_string [php.net]()