Page 3 of 3

Posted: Wed Mar 02, 2005 8:56 am
by smpdawg
Are you still getting an error similar to this?
SELECT count(postID) AS rowcount FROM comments WHERE postID=
If so, go to this area and add this

Code: Select all

while ($row = mysql_fetch_array($result, MYSQL_NUM))
      {   
         //puta

Code: Select all

print_r($row);
Do a view source and grab the stuff that mentions array and post it here.

Posted: Wed Mar 02, 2005 8:59 am
by pleigh
here is what appears
Array ( [0] => March 2nd, 2005 - 10:41 PM [1] => 14the report [2] => 16 [3] => pleigh ) pleigh
14the report
1
March 2nd, 2005 - 10:41 PM

Array ( [0] => March 2nd, 2005 - 5:53 PM [1] => new topic [2] => 17 [3] => jeff ) jeff
new topic
2
March 2nd, 2005 - 5:53 PM

Array ( [0] => March 2nd, 2005 - 3:21 PM [1] => 13th report [2] => 15 [3] => pleigh ) pleigh
13th report
0
March 2nd, 2005 - 3:21 PM

Array ( [0] => March 2nd, 2005 - 3:18 PM [1] => 12th report [2] => 14 [3] => pleigh ) pleigh
12th report
0
March 2nd, 2005 - 3:18 PM

Array ( [0] => March 2nd, 2005 - 3:17 PM [1] => 11th report [2] => 13 [3] => pleigh ) pleigh
11th report
0
March 2nd, 2005 - 3:17 PM

Array ( [0] => March 1st, 2005 - 9:08 PM [1] => 10th report [2] => 12 [3] => pleigh ) pleigh
10th report
3
March 1st, 2005 - 9:08 PM

Array ( [0] => March 1st, 2005 - 8:12 PM [1] => 9th report [2] => 11 [3] => pleigh ) pleigh
9th report
0
March 1st, 2005 - 8:12 PM

Array ( [0] => March 1st, 2005 - 8:11 PM [1] => 8th report [2] => 10 [3] => pleigh ) pleigh
8th report
0
March 1st, 2005 - 8:11 PM

Array ( [0] => March 1st, 2005 - 8:09 PM [1] => 7th report [2] => 9 [3] => pleigh ) pleigh
7th report
0
March 1st, 2005 - 8:09 PM

Array ( [0] => March 1st, 2005 - 8:08 PM [1] => 6th report [2] => 8 [3] => pleigh )

Posted: Wed Mar 02, 2005 9:05 am
by smpdawg
That looked normal. What is happening?

Posted: Wed Mar 02, 2005 9:07 am
by pleigh
honestly, i really have no idea.. :) ...but the code is working except for the error message that i am receiving

Posted: Wed Mar 02, 2005 9:14 am
by smpdawg
Is it the same error message? Is this site somewhere that I can see it?

Posted: Wed Mar 02, 2005 9:16 am
by pleigh
yah, this one
Warning: Missing argument 1 for replies() in c:\inetpub\wwwroot\mysample\functions\library.php on line 321
Error with SELECT count(postID) AS rowcount FROM comments WHERE postID=
if i am not mistaken, it is in the query that causes the problem.....or the arguement...really don't know....

Posted: Wed Mar 02, 2005 9:19 am
by smpdawg
So what is on line 321 in the library.php file?

Posted: Wed Mar 02, 2005 9:43 am
by CoderGoblin
Just wondering... What happens if you change

Code: Select all

<td width=10% class=tableborder><table><tr><td>".replies($row&#1111;2])."</td></tr></table></td>
to

Code: Select all

<td width=10% class=tableborder><table><tr><td>".replies(floor($row&#1111;2]))."</td></tr></table></td>
I take it postID is a number.

Posted: Wed Mar 02, 2005 11:32 pm
by pleigh
hi guys, sori about last night....i went home to rest.....to continue my problem, i did what coder ask me

changed this line from

Code: Select all

<td width=10% class=tableborder align=center><table><tr><td>".replies($row&#1111;2])."</td></tr></table></td>
to this one

Code: Select all

<td width=10% class=tableborder align=center><table><tr><td>".replies(floor($row&#1111;2]))."</td></tr></table></td>
the same error prompts
Warning: Missing argument 1 for replies() in c:\inetpub\wwwroot\mysample\functions\library.php on line 321
Error with SELECT count(postID) AS rowcount FROM comments WHERE postID=

Posted: Wed Mar 02, 2005 11:46 pm
by smpdawg
So back to my original question. What is line 321 in the file c:\inetpub\wwwroot\mysample\functions\library.php?

I want to see just that line.

Posted: Wed Mar 02, 2005 11:50 pm
by pleigh
thanks smpdawg...this is the line

Code: Select all

function replies($postID)

[SOLVED]

Posted: Thu Mar 03, 2005 1:33 am
by pleigh
put this line of code before the mysql query to debug the error

Code: Select all

function replies($postID)
&#123; 
     if(empty($postID)) 
    &#123;
        echo '<pre>';
        var_dump(debug_backtrace());
        echo '</pre>';
    &#125;
    //other codes goes here
&#125;
i found out that the viewing page has a problem

thanks for the time guys....

Posted: Thu Mar 03, 2005 5:10 am
by timvw
btw, if i understand a little, if a post doesn't have comments, i won't appear in the resultset. usually this is unwanted, and it should say there are 0 comments instead...


i solve this like:

Code: Select all

SELECT 
  m.message_id AS message_id, 
  m.datetime AS datetime, 
  IF(ISNULL(comment_id), 0, COUNT(*)) AS count 
FROM 
  message AS m 
  LEFT JOIN comment AS c USING (message_id) 
GROUP BY 
  m.message_id