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