Jump to content

skyhighweb

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by skyhighweb

  1. i don't understand the question (updated) oh yeah seen it, have changed it, but still effect i still get full datas from the menu side
  2. i have been trying, for example have been working on the below code it doing what i want but problem with it is it displays all data in a table instead of whats been viewed at the moment <?php require_once('conn.php'); ini_set('display_errors',0); $query = "SELECT b.auction, b.bidder, b.tagged, b.willwin, b.willlose, a.id, a.team1, a.team2 FROM " . $DBPrefix . "vs_auctions a LEFT JOIN " . $DBPrefix . "vs_bids b ON (b.auction = a.id) LEFT JOIN " . $DBPrefix . "vs_sports s ON (s.team_id = b.id) WHERE a.id = b.auction and a.id = a.id group by b.auction"; $country_result = $conn->query($query); ?> <select name="country" id="vs_sports-list" onchange="changeSelect( this.value )"> <option value="1">Select Team</option> <?php if ($country_result->num_rows > 0) { // output data of each row while($row = $country_result->fetch_assoc()) { ?> <option value="<?php echo $row["willwin"]; ?>"><?php echo $row["team1"]; ?></option> <option value="<?php echo $row["willlose"]; ?>"><?php echo $row["team2"]; ?></option> <?php } } ?> </select> </br></br></br><div id="subcats"> <select name="bidder" id="vs_bids-list"> <option value='1'>Select Number</option> </select></div> <?php $willlose = mysql_real_escape_string($_POST['willlose']); if($willlose!='') { $vs_bids_result = $conn->query('select b.auction, b.bidder, b.tagged, b.willwin, b.willlose from vs_bids b where willlose='.$willlose.' '); $options = "<option value=''>Select Name</option>"; while($row = $vs_bids_result->fetch_assoc()) { $options .= "<option value='".$row['id']."'>".$row['bidder']."</option>"; } echo $options; } ?> <script src="js/dropdown/jquery-1.3.0.min.js"></script> <script> $('#vs_sports-list').on('change', function(){ var willlose = this.value; $.ajax({ type: "POST", data:'willlose='+willlose, success: function(result){ $("#vs_bids-list").html(result); } }); }); </script> in my existing code i am using this $query = "SELECT a.id, a.team1, a.team2, b.auction, b.bidder, b.tagged, b.willwin FROM " . $DBPrefix . "auctions a LEFT JOIN " . $DBPrefix . "bids b ON (b.auction = a.id) WHERE a.id = :auc_id and a.id = a.id group by a.id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); thats display only what been viewed at the moment
  3. hi, i am no where near a submenu drop down linked to menu, all i have is a field for the menu and a field for the submenu seperately, auc_id is used to display only data being viewed at the moment.
  4. i can get the first value wwith a form but getting the sub menu is the issue for me else would have done that, just look tru for me n assist me, that wwill b great thanks, either JavaScript or ajax cant seem to get it to connect.
  5. hi, am stuck on linking the sub menu to the menu, as u can see from the codes i manually select them, i just need em link, thanks
  6. hello programmers again really need your help with this, i Need a menu linked to a sub menu i have a menu code and a submenu code but they arent linked, both i select manually, so i need help linking both of them. the menu consist of two values team1 and team2 i want when i select team1 it should drop down a menu of users who selected team1 and vice versa. for the MENU we got two tables they are auctions: with column: id team1 team2 bids: with column: auction bidder willwin and for the sub menu we also have two tables bids with: column: auction bidder willwin users with: column: nick MENU CODE // MENU team select $query = "SELECT a.id, a.team1, a.team2, b.auction, b.bidder, b.tagged, b.willwin, b.willlose FROM " . $DBPrefix . "auctions a LEFT JOIN " . $DBPrefix . "bids b ON (b.auction = a.id) WHERE a.id = :auc_id and a.id = a.id group by a.id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); $TPL_team_list = '<select name="willwin" class="form-control">' . "\n"; while ($row = $db->fetch()) { $TPL_team_list .= "\t" . ' <option value="' . $row[''] . '" ' . $selected . '>' . $row[''] . '</option> <option class="team1" value="' . $row['team1'] . '" ' . $selected . '>' . $row['team1'] . '</option> <option class="team2" value="' . $row['team2'] . '" ' . $selected . '>' . $row['team2'] . '</option> ' . "\n"; } $TPL_team_list .= '</select>' . "\n"; { $template->assign_block_vars('tag_bidder', array( 'TEAM' => $TPL_team_list, )); $i++; } SUBMENU CODE // SUBMENU user name $query = "SELECT b.*, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) WHERE b.bidder NOT IN ('b.tagged') and b.tagged IN ('b.bidder') and b.auction = :auc_id order by b.willwin"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); $TPL_team_list = '<select name="tagged" class="form-control">' . "\n"; while ($row = $db->fetch()) { $TPL_team_list .= "\t" . ' <option value="' . $row[''] . '" ' . $selected . '>' . $row[''] . '</option> <option value="' . $row['bidder'] . '" ' . $selected . '>' . $row['nick'] . '...' . $row['willwin'] . '</option> ' . "\n"; } $TPL_team_list .= '</select>' . "\n"; { $template->assign_block_vars('tag_bidder', array( 'NAME' => $TPL_team_list, )); $i++; } really looking forward to ur help thanks.
  7. i am trying something hopefully that works also posted a issue about it
  8. hi how do i rewrite this $country_result = $conn->query('select * from sports'); and this $bids_result = $conn->query('select * from bids where willwin='.$willwin.''); $options = "<option value=''>Select Name</option>"; while($row = $bids_result->fetch_assoc()) { $options .= "<option value='".$row['id']."'>".$row['bidder']."</option>"; to work like this $query = "SELECT a.id, a.team1, a.team2, b.auction, b.bidder, b.tagged, b.willwin, b.willlose FROM " . $DBPrefix . "auctions a LEFT JOIN " . $DBPrefix . "bids b ON (b.auction = a.id) WHERE a.id = :auc_id and a.id = a.id group by a.id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); thanks
  9. hi am having problem on the drop down part if i knew what to do i would have stopped posting questions n do it
  10. the code above is a form with drop down n also can submit i just need it to have a submenu
  11. hi jsg thanks for ur reply, have been over it again n again cant even seem to get it to work, please help me out with it, i will b glad n have a good nite sleep today, thanks
  12. i totally understand wwhat u saying my friend but i just dont know how to start about it thats y i posted the menu code am using, can u plz take a look at it for me n help out, will b grate ful
  13. yeah am trying to make a dropdown that depends on other drop down but no idea how to go about it
  14. still waiting for ur assistance peeps
  15. hi programmers how u doing? i need help creating a sub menu but with a twist MENU Submenu- team1 on click will display dropdown list of team2 lists team2 on click will display dropdown list of team1 lists if a user select (team1) it should drop down list of [team2] and if the user select (team2) it should drop list of [team1]. the code below is only a menu without submenu need ur assistance, thanks alot // team select $query = "SELECT a.id, a.team1, a.team2, b.auction, b.bidder, b.tagged, b.willwin FROM " . $DBPrefix . "auctions a LEFT JOIN " . $DBPrefix . "bids b ON (b.auction = a.id) WHERE a.id = :auc_id and a.id = a.id group by a.id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); $TPL_team_list = '<select name="willwin" class="form-control">' . "\n"; while ($row = $db->fetch()) { $TPL_team_list .= "\t" . ' <option value="' . $row[''] . '" ' . $selected . '>' . $row[''] . '</option> <option value="' . $row['team1'] . '" ' . $selected . '>' . $row['team1'] . '</option> <option value="' . $row['team2'] . '" ' . $selected . '>' . $row['team2'] . '</option> ' . "\n"; } $TPL_team_list .= '</select>' . "\n"; { $template->assign_block_vars('tag_bidder', array( 'TEAM' => $TPL_team_list, )); $i++; } Tables : auctions columns: id(int), team1, team2 3 chelsea ajax Tables : bids columns: auction(int) bidder willwin 3 9 chelsea 3 5 ajax 3 7 chelsea 3 2 ajax 3 6 chelsea 3 4 chelsea
  16. i added it but nothing seem to happen
  17. thanks for d reply, how do i implement that in d above code, thanks
  18. am having a duplicate result because of bids. i need to limit the result for only auctions to 1, i tried "limit 1" but they all get limited to 1 both bids n auctions, how do i limit only auctions to 1 how do i go about this, thanks. $query = "SELECT b.*, u.nick, a.id, a.team1, a.team2 FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) LEFT JOIN " . $DBPrefix . "auctions a ON (a.id = b.auction) WHERE b.bidder NOT IN ('b.tagged') and b.tagged IN ('b.bidder') and b.auction = :auc_id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params);
  19. yeap i changed the name from buyer to bidder n implemented the not in code it working fine now, thanks alot
  20. yeah it was missing a user_id thanks peeps
  21. please closed already solved thanks for ur effort
×
×
  • Create New...