Jump to content

Strings confusion? (sorry I've no idea)


soltek

Recommended Posts

Hey there again, this is hard for me to explain so you better take a look at the code first so you can understand me better.

 

 


    $news = mysql_query("SELECT id, username, avatar, team FROM users WHERE team ='5' ORDER BY id DESC LIMIT 6");  ///limit number of images 
$res = mysql_query("SELECT users.id AS users_id, owner, nome, image, descric, T1 AS teams_T1, T2, T3, L1, L2, L3, teams.id AS tid,  
users.avatar AS owner_avatar 
FROM teams LEFT JOIN users ON teams.owner = users.id
where teams.id = $id")
or sqlerr();
$row = mysql_fetch_array($res);



<td colspan=5 rowspan=6 background=images/equipas/equipas_10.png width=217 height=135>

/////////////////////TRICKY PART///////////
<?        print("<ul>");
        while ($row2 = mysql_fetch_array($news, MYSQL_NUM)) {
            $tor = $row2['0'];
            $altname = $row2['1'];
  			$where = "WHERE users.id='$tor'";
            $res = mysql_query("SELECT users.id, users.avatar, users.username, users.team FROM users $where");
            $row = mysql_fetch_array($res);

            $img1 = "<a href='$site_config[sITEURL]/user-details.php?id=$row[id]'><img class='owner_border' src='$row[avatar]' alt=\"\" width=50 height=50 title=\"$row[username]\"></a>";

                print("<li>". $img1 ."</li>");
            
        }
        print("</ul>");
    
?>
////////////////////TRICKY PART////////////////////////////
</td>
	<td width=229 height=26 bgcolor=#2F2F2F>
		<?print("$row[T1]");?>
	</td>

 

So, the thing is that every.... $row[whatever] (I dont know how this is called) after the tricky part, stops working as it should. For example, the print("$row[T1]") prints a blank space. If I change the T1 to id, it prints the id given by the tricky part string.

And the funny thing is that if I delete the tricky part, everything else works fine :s

 

Do you guys have any idea what i am doing wrong and how to fix it?

Thank you

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.