showing product instead of ID number

silks

New Member
how can i show giftid as which gift on my forum?
EG:
<td class="$bgclass" align="center">
<span class="{$Style['small']}">$row[sender] sent a $row[giftid] to $row[recipient], send <a href="/forum/gifts.php">gifts</a></span>
</td>
</tr>


obviously gift id comes out as a number - i would like it printed as the actual gift name

can some one help please
 
the mod is Gifts - im just trying to put a live feed on my cmps page

(which works) the only truble im having is getting the row gift id to show the name of the gift rather than the id number ie:8 --unfortunatly the table does not do the gift name (well it does but its called title) and the title will choose a random id when i make it display for eg "user3 sent a "drink" to user4" when infact user 3 had sent a "nudge"...

so my dilema is how do i resolve this gift id with what i have to work with in the gift table??

hope this makes sense
 
ok i tried something different

$result = mysql_query("SELECT sender, gifttypeid, giftid, image, dateline, recipient FROM gifts,gift_type WHERE sender != '' AND recipient != '' ORDER BY giftid DESC LIMIT 0,1" ) or die(mysql_error());

while($row = mysql_fetch_array( $result )) {


<tr>
<td class="$bgclass" align="center">
<span class="{$Style['small']}">$row[sender] sent a <img src="/forum/giftsgifs[$row[gifttypeid].gif" width="20px"> to $row[recipient]</span>
</td>
</tr>

for some reason it wont display gifttypeid - the page returns

"gifttypeid is an ambiguous column"

can someone tell me what im doing wrong to get the result i want (display which gift has been sent)

fAnks
 
Back
Top