Jump to content

skyhighweb

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by skyhighweb

  1. arr jeez sorry wrong code tot i copied it right so sorry heres d code i use // tagged $query = "SELECT b.*, u.nick FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) LEFT JOIN " . $DBPrefix . "bids_tagged bt ON (bt.id = b.bidder) WHERE b.bidder NOT IN ('b.tagged') and b.tagged IN ('bt.bidder') and b.auction = :auc_id "; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); if ($bidder = $tagged) { // Also insert bids_tagged table $query = "INSERT INTO " . $DBPrefix . "bids_tagged VALUES (NULL, :auc_id, :bidder_id, :bid, :time, :qty, :willwin, :tagged, :balance)"; $params = array(); $params[] = array(':bid', $bid, 'float'); $params[] = array(':auc_id', $id, 'int'); $params[] = array(':bidder_id', $bidder_id, 'int'); $params[] = array(':time', $NOW, 'int'); $params[] = array(':qty', $qty, 'int'); $params[] = array(':willwin', $willwin, 'str'); $params[] = array(':tagged', $tagged, 'int'); $params[] = array(':balance', $balance, 'int'); $db->query($query, $params); // update bids $query = "UPDATE " . $DBPrefix . "bids SET bidder = (tagged)"; $params[] = array(':auc_id', $id, 'int'); $db->direct_query($query); } $i = 0; while ($row = $db->fetch()) { $template->assign_block_vars('tag_bidder', array( 'ID' => $row['bidder'], 'NAME' => $row['nick'], 'WILLWIN' => $row['willwin'], 'TAGGED' => $row['tagged'] )); $i++; }
  2. thats the code i use for insert updating it doesnt work fine
  3. good morning all, here is the complete code skyhighweb 21h 1 $query = "SELECT b.*, u.nick 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 "; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); // Also update bids table $query = "INSERT INTO " . $DBPrefix . "bids VALUES (NULL, :auc_id, :bidder_id, :bid, :time, :qty, :willwin, :tagged, :balance)"; $params = array(); $params[] = array(':bid', $bid, 'float'); $params[] = array(':auc_id', $id, 'int'); $params[] = array(':bidder_id', $bidder_id, 'int'); $params[] = array(':time', $NOW, 'int'); $params[] = array(':qty', $qty, 'int'); $params[] = array(':willwin', $willwin, 'str'); $params[] = array(':tagged', $tagged, 'str'); $params[] = array(':balance', $balance, 'str'); $db->query($query, $params); $i = 0; while ($row = $db->fetch()) { $template->assign_block_vars('tag_bidder', array( 'ID' => $row['bidder'], 'NAME' => $row['nick'], 'WILLWIN' => $row['willwin'], 'TAGGED' => $row['tagged'] )); $i++; }
  4. i have tried updating but it doesnt work i tried this bids set tagged = (bidder) the data looks like this bidder......tagged david ..... david mike ..... david instead of bidder......tagged david ..... mike mike ..... david
  5. hi programmer i have an issue here. so let me explain better, if david place a bid but doesnt tag any one the column looks like this bidder......tagged david ..... 0 and if someone else(mike), place a bid and tag david the column look like this bidder......tagged Mike ..... david this shows both mikes and david rows bidder......tagged david ..... 0 mike ..... david u can see david row doesnt update, it should show mike and not 0, hope u understand. below is the code am using to fill the form // tag someone $query = "SELECT b.*, u.nick 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 "; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); $i = 0; while ($row = $db->fetch()) { $template->assign_block_vars('tag_bidder', array( 'ID' => $row['bidder'], 'NAME' => $row['nick'], 'TAGGED' => $row['tagged'] )); $i++; }
  6. hello programmers am having an update issue and i dont know how to go about it am gonna try n explain it the way i can plz bear with me. i have a table called bids and two important column called bidder and tagged when (bidder 5) has no one to tag he simple drops a bid and when another bidder comes along(bidder 3) he tags (bidder 5) i want bidder 5 row to update showing (bidder 3)in his row. for example bidder 5 place bid it looks like this bidder tagged 5 0 no one to tag so it shows zero i want if bidder 5 get tagged by bidder 3 it update showing the person that tag bidder 5 and it will look like this bidder tagged 5 3 from the image i attached u can simply understand what am saying. looking forward to ur replies thanks code i am using to fill the form is below // tag someone $query = "SELECT b.*, u.nick 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 "; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); $i = 0; while ($row = $db->fetch()) { $template->assign_block_vars('tag_bidder', array( 'ID' => $row['bidder'], 'NAME' => $row['nick'], 'TAGGED' => $row['tagged'] )); $i++; }
  7. the simple code seem to help i did it this was thou WHERE col1 NOT IN (' col2 ') and col2 IN (' col2 ')
  8. i think i got it using ur idea still running to see nothing freaking is on, i did this WHERE bidder NOT IN ('tagged') and tagged IN ('bidder')";
  9. i tried what u gave me but no result, i implemented it like this $query = "SELECT * FROM bids WHERE bidder NOT IN (SELECT tagged FROM bids)"; $params = array(); $db->query($query, $params); $i = 0; while ($row = $db->fetch()) { $template->assign_block_vars('tag_bidder', array( 'BGCOLOUR' => (!($i % 2)) ? '' : 'class="alt-row"', 'ID' => $row['bidder'], 'TAGGED' => $row['tagged'] )); $i++; }
  10. and yet am not getting the issue solved, i dropped down d full code am using for the form i even asked u to assist implement it atleast this way i know what am doing
  11. need a help with a PHP/MySQL issue. I have a table named bids and two column named bidder and tagged both using int. the 4 below appears 2twice in both columns need the code to check both columns not minding where the data is in the row and wont display it in the result bidder tagged 4 5 2 0 6 4 thats the code am using below $query = "SELECT b.auction, b.bidder, b.bid, b.tagged, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) WHERE b.auction = :auc_id ORDER BY b.bid asc, b.quantity DESC, b.willwin asc"; $params = array(); $params[] = array(':auc_id', $id, 'int');
  12. oh i see, and ur code are pdo am using mysql i believe thats y am seeing d error
  13. heres the ccomplete code $query = "SELECT b.auction, b.buyer, b.bid, b.tagged, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) WHERE b.auction = :auc_id ORDER BY b.bid asc, b.quantity DESC, b.willwin asc"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $i = 0; $hbidder_data = array(); foreach ($db->fetchall() as $bidrec) { if (!isset($bidderarray[$bidrec['nick']])) { if ($system->SETTINGS['buyerprivacy'] == 'y' && (!$user->logged_in || ($user->user_data['id'] != $auction_data['user'] && $user->user_data['id'] != $bidrec['bidder']))) { $bidderarray[$bidrec['nick']] = $bidrec['nick']; $bidderarraynum++; } } $template->assign_block_vars('tag_bidder', array( 'BGCOLOUR' => (!($i % 2)) ? '' : 'class="alt-row"', 'ID' => $bidrec['bidder'], 'NAME' => $bidderarray[$bidrec['nick']] )); $i++; } am a newbie am still figuring out php thats d code i use for the form plz intergrate for me thanksm, sorry for the stress
  14. mind reading as in? some one drop this code buyer != tagged that works if the value are on the same line eg bidder tagged 2 1 4 4 8 6 with the 4 like it works isnt there anycode that can check even its on the last row? and like i said b4 am a newbie so given me a code will simply means copy n pasting with little edit
  15. but it showing error or am i implementing it wrong? can u implement for me in my code i added above? so i know what am doing wrong
  16. ok this is what am saying and want columns buyer tagged 5 3 3 2 6 0 the 3 is in both so i dont want it to display. someone drop this code which i used buyer != tagged it only work if the row looks like this buyer tagged 3 3 5 2 6 0 the 3 are on the same row then it will work, but i only altered that manually to check it out not what i want, also i tried ur codes again same error can it b a where not in code of some sort or something
  17. hi thanks for taking d time to write i just added the code n am getting error null n long error msgs
  18. i just need it not to display if found any where in both buyer and tagged
  19. bidder as it row tagged as it row
  20. i don't understand what am doing wrong here plz some one help with implementing it in this code of mine i tried the codes alone but didnt return a result. note: the data are not on the same line or roll, they are just in the same columns (bidder and tagged) $query = "SELECT b.auction, b.bidder, b.bid, b.tagged, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) WHERE b.auction = :auc_id ORDER BY b.bid asc, b.quantity DESC, b.willwin asc"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $i = 0; $hbidder_data = array(); foreach ($db->fetchall() as $bidrec) { if (!isset($bidderarray[$bidrec['nick']])) { if ($system->SETTINGS['buyerprivacy'] == 'y' && (!$user->logged_in || ($user->user_data['id'] != $auction_data['user'] && $user->user_data['id'] != $bidrec['bidder']))) { $bidderarray[$bidrec['nick']] = $bidrec['nick']; $bidderarraynum++; } } $template->assign_block_vars('tag_bidder', array( 'BGCOLOUR' => (!($i % 2)) ? '' : 'class="alt-row"', 'ID' => $bidrec['bidder'], 'NAME' => $bidderarray[$bidrec['nick']] )); $i++; }
×
×
  • Create New...