skyhighweb

Members
  • Content count

    74
  • Joined

  • Last visited

Community Reputation

0 Neutral

About skyhighweb

  • Rank
    Newbie
  1. so this is like an example i believe right
  2. hi i kinda want it to hide hide as in the code shows result like this 4 Chelsea Chelsea i want the 4 to hide but still be able to be submitted.
  3. hi how do i hide the (team_id) value in the below form <option value="' . $row['team_id'] . '' . $row['teams'] . '" ' . $selected . '>' . $row['teams'] . '</option> thanks
  4. ok done did it this way just incase someone wants to know how $query = "SELECT sss.team_id, sss.teams AS teams2, ss.team_id, ss.teams AS teams1, s.team_id, s.teams, a.current_bid, a.current_bid_id, a.id, a.team1, a.title, a.team2, a.ends, a.starts, u.nick, b.bid, b.tagged, b.bidder, b.willwin, b.quantity, p.bid As proxybid, b.id As bid_id FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "proxybid p ON (p.itemid = b.auction AND p.userid = b.bidder) LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = b.willwin) LEFT JOIN " . $DBPrefix . "auctions a ON (a.id = b.auction) LEFT JOIN " . $DBPrefix . "sports ss ON (ss.team_id = a.team1) LEFT JOIN " . $DBPrefix . "sports sss ON (sss.team_id = a.team2) LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.tagged)
  5. i need to connect team1 and team2 to a table called sports so i can get there names which is in column called (teams) how do i do that i already connected sports to another table as u can see in the code, how do i go about this, thanks. $query = "SELECT s.team_id, s.teams, a.current_bid, a.current_bid_id, a.id, a.team1, a.title, a.team2, a.ends, a.starts, u.nick, b.bid, b.tagged, b.bidder, b.willwin, b.quantity, p.bid As proxybid, b.id As bid_id FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "proxybid p ON (p.itemid = b.auction AND p.userid = b.bidder) LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = b.willwin) LEFT JOIN " . $DBPrefix . "auctions a ON (a.id = b.auction) LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.tagged)
  6. yeah i understand what u saying i keep trying it but doesnt burge
  7. thansk for replying i use a tpl as frontend display, but the code above the first one cant work in tpl unless convertered this is the full code below $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); ?> <script type="text/javascript" src="js/dropdownjquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#willwin").change(function() { $(this).after('<div id="loader"><img src="images/loading.gif" alt="loading subcategory" /></div>'); $.get('loadsubcat.php?willwin=' + $(this).val(), function(data) { $("#sub_cat").html(data); $('#loader').slideUp(200, function() { $(this).remove(); }); }); }); }); </script> <form name="bid"> <label for="category">Select Winner</label> <select name="willwin" id="willwin"> <?php if ($db->numrows() > 0){ while ($row = $db->fetch()) { ?> <option value=''></option> <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/> <label>Tag Bettor</label> <select name="sub_cat" id="sub_cat"></select> </form> it only works inside php files and not tpl below is an example of a php with tpl connector // team $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 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++; } hope u understand what am trying to accomplish
  8. how do i convert this <select name="willwin" id="willwin"> <?php if ($db->numrows() > 0){ while ($row = $db->fetch()) { ?> <option value=''></option> <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/> <label>Tag Bettor</label> <select name="sub_cat" id="sub_cat"></select> to look like this $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++; } i cant intergrate the above form (doesnt respond when place directly) in tpl unless converted
  9. yeah true, but fixed anyway.
  10. ok so after checking em am finally getting close i have them connected to one database and converted them from conn to db, the menu works fine but the sub menu disappears when i select a menu, the code below plz chk for me what am doing wrong thanks, i might not have converted all or missing a code or something $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); ?> <select name="country" id="sports-list" onchange="changeSelect( this.value )"> <option value="1">Select Team</option> <?php if ($db->numrows() > 0) { // output data of each row while ($row = $db->fetch()) { ?> <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="bids-list"> <option value='1'>Select Number</option> </select></div> <?php $willlose = mysqli_real_escape_string($_POST['willlose']); if($willlose!='') { $query = "SELECT b.*, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) WHERE willlose=".$willlose." and 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); $options = "<option value=''>Select Name</option>"; while ($row = $db->fetch()) { $options .= "<option value='".$row['auction']."'>".$row['nick']."</option>"; } echo $options; } ?> <script src="js/dropdown/jquery-1.3.0.min.js"></script> <script> $('#sports-list').on('change', function(){ var willlose = this.value; $.ajax({ type: "POST", data:'willlose='+willlose, success: function(result){ $("#bids-list").html(result); } }); }); </script>
  11. no i meant, using the previous form field, i can insert values into the table using $db without the drop down values which i iinsert maunaly from the database backend into the row, but with the $conn i can only view those values along side the drop down values. u know what is there a way i can message u the script so u see for ur self along side what am trying to do?
  12. it produces the correct result, the problem now is the script am using as u can see is different from what have been using, have tried changing things around so the script can connect to a db and not conn i have two seperate connection, db is the one have been using while conn is the one that came along with the drop menu code
  13. yeah checked i remove all the b. i wasnt even joining anything, if only i could try rewrite this 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) WHERE a.id = b.auction and a.id = a.id group by b.auction"; $country_result = $conn->query($query); so it will look 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); so i can stay connected to my database with this config file <?php $DbHost = "localhost"; $DbDatabase = "vsb"; $DbUser = "root"; $DbPassword = "pass"; $DBPrefix = "vs_"; $main_path = "D:\\xampp\\htdocs\\vsbet\\"; $MD5_PREFIX = "ca801ec4f5c664bc6a492f942b3a07eb"; ?> that way i can simply intergrate the code smoothly , because right now it like am having two seperate connection acting differently
  14. 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
  15. yeah it it returns a value