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
https://forums.phpfreaks.com/topic/208518-strings-confusion-sorry-ive-no-idea/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.