Jump to content

lame i dont know what to do with this


ccrevcypsys

Recommended Posts

So when my code querys the db for all of the options section the value keeps equaling 1...

Heres the code taken off of the view source:

<select name="add" class="searchBox">
<option value="1" id="searchBox">New Music</option>
    
    	<option value="1" id="searchBox">My Music</option>
    
    	<option value="1" id="searchBox">Point Graph</option>
    
    	<option value="1" id="searchBox">New People</option>
    
    	<option value="1" id="searchBox">New Events</option>

    
    	<option value="1" id="searchBox">Hottest Songs</option>
    
    	<option value="1" id="searchBox">Highest Ranked People</option>
</select>

and those should match what it says in the database.

here is the php that i use to pull this info.

	$addChoice=$db->select("SELECT p.*, H.portal_id
 					 	FROM ".$glob['dbprefix']."StreamRush_portals p 
						LEFT JOIN ".$glob['dbprefix']."StreamRush_myHome H
						ON H.portal_id != p.portal_id
						WHERE p.portal_id != H.portal_id
						ORDER BY p.portal_id
						");

Link to comment
Share on other sites

Change it to:

 

<select name="add" class="searchBox">
<option value="1" id="searchBox">New Music</option>
<option value="2" id="searchBox">My Music</option>
<option value="3" id="searchBox">Point Graph</option>
<option value="4" id="searchBox">New People</option>
<option value="5" id="searchBox">New Events</option>
<option value="6" id="searchBox">Hottest Songs</option>
<option value="7" id="searchBox">Highest Ranked People</option>
</select>

Link to comment
Share on other sites

no it has to pull from the database

so the php code for the select looks like this

 

<?php
	$addChoice=$db->select("SELECT p.*, H.portal_id
 					 	FROM ".$glob['dbprefix']."StreamRush_portals p 
						LEFT JOIN ".$glob['dbprefix']."StreamRush_myHome H
						ON H.portal_id != p.portal_id
						WHERE p.portal_id != H.portal_id
						ORDER BY p.portal_id
						");
if($addChoice==TRUE){
for($i=0;$i<count($addChoice);$i++){
	$index->assign("PORTAL_ID", $addChoice[$i]['portal_id']);
	$index->assign("PORTAL_NAME", $addChoice[$i]['portal_name']);
$index->parse("index.portals");	
}
        }else{
	$index->assign("PORTAL_NAME", "You already have them all");
}
?>

<select name="add" class="searchBox">
<!-- BEGIN: portals -->
    	<option value="<?php echo $addChoice[$i]['portal_id']; ?>" id="searchBox">
            <?php echo $addChoice[$i]['portal_name']; ?></option>
    <!-- END: portals-->
</select>


Link to comment
Share on other sites

Any ideas????

 

the tables look like this

 

----portals----          ----myHome----        ----customer----

portal_id      ---+              id                +--  customer_id

portal_name    +---    portal_id            |    customername

                                customer_id  -----+

                                  position       

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.