display content in a hidden div based on list using ID
Posted: Fri Sep 14, 2012 11:16 am
I am really stuck here.
I have a select list that is getting products off a mySQL db the products displayed in a select list. when one of the items is selected i want the content to show is a new div on the same page. I currently have the select list worlking but i dont know where to go from there.
here is what i have
so when the record is selected i need the rest of the information to show up under the select list
thanks in advance
I have a select list that is getting products off a mySQL db the products displayed in a select list. when one of the items is selected i want the content to show is a new div on the same page. I currently have the select list worlking but i dont know where to go from there.
here is what i have
Code: Select all
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_beau, $beau);
$query_Recordset1 = "SELECT * FROM beaProdSizes, beauCat WHERE beaProdSizes.CatID = beauCat.catID";
$Recordset1 = mysql_query($query_Recordset1, $beau) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<form id="FormName" action="" method="get" name="FormName">
<select id="selectName" name="name">
<option value="Select Design">Select Design</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['name']; ?>"><?php echo $row_Recordset1['name']; ?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
so when the record is selected i need the rest of the information to show up under the select list
thanks in advance