Jump to content

updating a user row (explained)


skyhighweb

Recommended Posts

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++;
}
Edited by cyberRobot
added [code][/code] tags; indented code
Link to comment
Share on other sites

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.

 

What does your code for updating the database look like? Do you have code for updating David's record when he's tagged by someone else?

 

What is supposed to happen if Sue places a bid and also tags David? It seems like David's bid record should be 0, unless he tags someone else. If you need to know who tagged David, you would search for any references to him in other people's tagged column.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.