Iryk Posted June 3, 2006 Share Posted June 3, 2006 [code]<?$query = "SELECT * FROM `topics` WHERE `Category`='$category' ORDER BY `ID` DESC LIMIT 0,30";$result = "mysql_query(" . $query . ")";$get = "mysql_fetch_array(" . $result . ")";$i = 1; echo "<table>"; while($get) { $id = $get['ID']; $topic = $get['Topic']; $author = $get['Author']; $date = $get['Date']; $replies = mysql_num_rows(mysql_query("SELECT * FROM `replies` WHERE `Topic`='" . $topic . "'")); if($i % 2 == "1") { $bgcolor = "#E4E4E4"; } else { $bgcolor = "#EEEEEE"; } echo "<tr bgcolor='" . $bgcolor . "'>"; echo "<td width='50%'>" . $topic . "</td>"; echo "<td width='20%'>" . $author . "</td>"; echo "<td width='20%'>" . $date . "</td>"; echo "<td width='10%'>" . $replies . "</td>"; echo "</tr>"; $i++; } echo "</table>";?>[/code]It is only giving the result of m for my values. Can some one please tell me what I am doing wrong? Link to comment https://forums.phpfreaks.com/topic/11107-all-i-am-getting-is-m/ Share on other sites More sharing options...
AndyB Posted June 3, 2006 Share Posted June 3, 2006 I don't know if this is part of your problem, but I've never seen code like this:[code]$result = "mysql_query(" . $query . ")";$get = "mysql_fetch_array(" . $result . ")";[/code]Try changing that to:[code]$result = mysql_query($query);$get = mysql_fetch_array($result);[/code] Link to comment https://forums.phpfreaks.com/topic/11107-all-i-am-getting-is-m/#findComment-41551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.