Jump to content

select probs


ccrevcypsys

Recommended Posts

i have a drop down menu that lets you add things to your home page.

there are 2 databases that this info is pulled from

 

Portals          |      myHome

----------------------------------

portal_id ----++----portal_id        |

portal_name          customer_id  |

                          id                |

----------------------------------

 

So the code is

<select name='portal_id'>

<?php
	$addChoice=$db->select("SELECT p.*, H.customer_id
 			           FROM portals p 
				   LEFT JOIN myHome H
				   ON p.portal_id = H.portal_id 
				   WHERE H.customer_id != ".$ccUserData[0]['customer_id']." 
                                           AND H.portal_id IS NULL
				   ORDER BY p.portal_id");

for($i=0;$i<count($addChoice);$i++){
?>
<option value='<?php echo $addChoice[$i]['portal_id'];?>'> <?php echo $addChoice[$i]['portal_name'] ?></option>

<?php
}
?>
</select>

My goal is so that when people remove things it will show up in the option drop down. And it wont show the ones that are already on it. Right now it doesnt work like that. If somone could help i really need it...

Link to comment
https://forums.phpfreaks.com/topic/78315-select-probs/
Share on other sites

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.