Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,103 members, 7,818,294 topics. Date: Sunday, 05 May 2024 at 12:09 PM

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 (1018 Views)

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)

(1) (Reply) (Go Down)

Dear Programmers Need A Code For This Update Issue by skyhighweb(m): 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(m): 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(m): 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)

Edit My MMM Site / Medichost | Build Your Hospital Or Organization Software With Us Today / Well Coded Binary Option Script | Setup On The Cheap

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.