**SOLVED** Retrieve data associated to variable from
Posted: Tue Apr 19, 2005 7:01 am
Hi,
I've managed (with some help) to pass a variable to a popup window. now i'm having some troubles retrieving the associated table data. If I set 'WHERE stockId = '2''; I get the data I need, but this is not the right way to do it. I am unsure of where to progress with this? Does any one have a link or some examples I can view?
tks, Will
I've managed (with some help) to pass a variable to a popup window. now i'm having some troubles retrieving the associated table data. If I set 'WHERE stockId = '2''; I get the data I need, but this is not the right way to do it. I am unsure of where to progress with this? Does any one have a link or some examples I can view?
tks, Will
Code: Select all
// View Record Function
function viewFaceStock() {
html_header();
$stockId = $_GET['stockId'];
print_r($_SESSION);
print_r($_POST);
$query = "SELECT stockId, description, basisWeight, caliper FROM austock WHERE stockId = '$stockId'";
$result = mysql_query($query);
if(!$result) error_message(sql_error());
$query_data = mysql_fetch_array($result);
$stockId = $query_data["stockId"];
echo $stockId;
echo "<br>";