₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,298 members, 8,421,223 topics. Date: Saturday, 06 June 2026 at 02:45 AM

Toggle theme

Dear Programmers Need A Code For This Update Issue - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingDear Programmers Need A Code For This Update Issue (1110 Views)

1 Reply (Go Down)

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:
It can't update now since its not David that tagged but was tagged
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:
yeah anyway one can update it?
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:
did you write this code your self?
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:
rewrote em from an existing code
OK Now create a separate table to hold tags, create two columns named the tagger and the tagged grin. 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
1 Reply

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?234

Learn Javascript Variables - For PidginChoosing A Nigerian Forum For ProgrammersUpload To Playstore