soltek Posted July 22, 2010 Share Posted July 22, 2010 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 More sharing options...
Mchl Posted July 22, 2010 Share Posted July 22, 2010 You have $row = mysql_fetch_array($res); in line 9, then again in line 21 for different query (in which there's not T1 field). Link to comment https://forums.phpfreaks.com/topic/208518-strings-confusion-sorry-ive-no-idea/#findComment-1089487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.