Dear Programmers Need A Code For This Update Issue - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Dear Programmers Need A Code For This Update Issue (1111 Views)
| Dear Programmers Need A Code For This Update Issue by skyhighweb(op): 9:16am On May 08, 2017 |
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++; } |
| Re: Dear Programmers Need A Code For This Update Issue by cbrass(m): 6:54pm On May 08, 2017 |
It can't update now since its not David that tagged but was tagged |
| Re: Dear Programmers Need A Code For This Update Issue by skyhighweb(op): 7:57pm On May 08, 2017 |
cbrass:yeah anyway one can update it? |
| Re: Dear Programmers Need A Code For This Update Issue by cbrass(m): 8:48pm On May 08, 2017 |
skyhighweb:did you write this code your self? |
| Re: Dear Programmers Need A Code For This Update Issue by skyhighweb(op): 9:29pm On May 08, 2017 |
cbrass:rewrote em from an existing code |
| Re: Dear Programmers Need A Code For This Update Issue by cbrass(m): 10:35pm On May 08, 2017 |
skyhighweb:OK Now create a separate table to hold tags, create two columns named the tagger and the tagged . Let's say David is ID 1 and Mike is ID 2 , when David tags Mike is I'd 1 should be insert in tagger while 2 which is for Mike goes into tagged, that way you can use the data in anyway you want |
| Re: Dear Programmers Need A Code For This Update Issue by Nobody: 8:56am On May 09, 2017 |
to add to what the user above said, make both foreign keys in your new table, composite keys this will remove repeating rows |
Dear Programmers, How Do You Remember Your Syntax? • Dear Programmers - Don't Fall For This Scam [pictures] • Where Can I Find A Code Academy In Lagos, Close To Ogudu Or Anthony? • 2 • 3 • 4
Programming Language To Learn • Functional E_commerce Websites..... Make Million Sales Instantly • Pls I Need A Good Website Programmer
. Let's say David is ID 1 and Mike is ID 2 , when David tags Mike is I'd 1 should be insert in tagger while 2 which is for Mike goes into tagged, that way you can use the data in anyway you want