Im kind of a php newbie here so this might be basic to some. I am able to display the 'categoryName' in the loop but I need to display the associated 'companyID' as well. Heres the query (built from dreamweaver MX)
QUERY
<?php
$catID_pullListing = "1";
if (isset($HTTP_GET_VARS['textfield'])) {
$catID_pullListing = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['textfield'] : addslashes($HTTP_GET_VARS['textfield']);
}
mysql_select_db($database_MommynetSQL, $MommynetSQL);
$query_pullListing = sprintf("SELECT companyID, CompanyName FROM listonames WHERE Category = '$catID'", $catID_pullListing);
$pullListing = mysql_query($query_pullListing, $MommynetSQL) or die(mysql_error());
$row_pullListing = mysql_fetch_assoc($pullListing);
$totalRows_pullListing = mysql_num_rows($pullListing);
$colname_Recordset1 = "1";
if (isset($HTTP_POST_VARS['1'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['1'] : addslashes($HTTP_POST_VARS['1']);
}
$query_Recordset1 = sprintf("SELECT * FROM listonames WHERE `1` = '%s' ORDER BY `1` ASC", $colname_Recordset1);
?>
Heres the loop I am using that displays the 'CompanyName' field but wont display the 'companyID':
<?
while($CompanyName = mysql_fetch_row($pullListing)){
echo "<A HREF=companyDetails.php?compID=$companyID>$CompanyName[1]</A><BR>";
}
?>
QUERY
<?php
$catID_pullListing = "1";
if (isset($HTTP_GET_VARS['textfield'])) {
$catID_pullListing = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['textfield'] : addslashes($HTTP_GET_VARS['textfield']);
}
mysql_select_db($database_MommynetSQL, $MommynetSQL);
$query_pullListing = sprintf("SELECT companyID, CompanyName FROM listonames WHERE Category = '$catID'", $catID_pullListing);
$pullListing = mysql_query($query_pullListing, $MommynetSQL) or die(mysql_error());
$row_pullListing = mysql_fetch_assoc($pullListing);
$totalRows_pullListing = mysql_num_rows($pullListing);
$colname_Recordset1 = "1";
if (isset($HTTP_POST_VARS['1'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['1'] : addslashes($HTTP_POST_VARS['1']);
}
$query_Recordset1 = sprintf("SELECT * FROM listonames WHERE `1` = '%s' ORDER BY `1` ASC", $colname_Recordset1);
?>
Heres the loop I am using that displays the 'CompanyName' field but wont display the 'companyID':
<?
while($CompanyName = mysql_fetch_row($pullListing)){
echo "<A HREF=companyDetails.php?compID=$companyID>$CompanyName[1]</A><BR>";
}
?>