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>

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.