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? Quote 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] Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.