Jump to content

help with print_r function for a drop down menu ?


maxves1

Recommended Posts

hello, I have my php dynamic drop down menu at :

http://faculty.poly.edu/~yjeanpie/searchcat.php

 

As you can see, when you select a category and product, it displays the selected stuff on the other page, but that is not exactly what i wanna do, I want it to retrieve all other attributes related to the selection, from the database,

suppose I have selected software and photoshop ( from my PRODUCTS table in database) I want it to display those plus all other attributes related to photoshop say  tutorial links, id ,description ,etc, see the following for a brief idea:

http://faculty.poly.edu/~yjeanpie/generalinfo.php

 

so i need all those attributes to be pulled from database as soon as i select these 2 things from drop down,

i used the following print_r command on the results page, but its not working, can anyone help me fix it or rewrite it?>

 

 

 

<?php

 

 

print_r($_POST);

 

?>

 

<?php

require("db_connect.php");

 

/*$query = mysql_query("SELECT * FROM products NATURAL JOIN category WHERE prod_name='".$_POST['subcat']."'");

echo '<pre>';

print_r($row = mysql_fetch_assoc($query));

//echo .$row['prod_info'].;

echo '</pre>';

*/

print_r($_SESSION);

//while ($row = mysql_fetch_assoc($query)) {

foreach ($row as $col=>$val) {

if (!empty($val)) {

echo 'col: '.$col.' val: '.$val.'<br />';

}

}

echo '<br />';

//}

 

?>

 

 

</body>

</html>

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.