Results 1 to 12 of 12

Thread: another weird error

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    another weird error

    PHP Code:
    $num mysql_num_rows(mysql_query("SELECT * FROM reviews"));
                                
    //echo $num-5;
                                
    if(($num-5)<=0){
                                    
    $sql "SELECT * FROM reviews LIMIT $num";
                                }
                                else{
                                    
    $sql "SELECT * FROM reviews LIMIT $num-5, 5";
                                }

                                
    $result mysql_query($sql);
                                while (
    $rrow mysql_fetch_array($rresult)) {
                                    
    printf("<li><a href=\"viewreview.php?id=%s&sys=%s\">%s</a></li>"$row['id'], $row['system'], $row['gamename']);
                                } 
    it gives an error on the "while" line...any ideas? my select is correct, because if i do "echo $num-5", itll return the correct number
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    and

    [code]Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 188

    Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 189]/code]


    its complaining about the <head> </head> portion of my thing, is there a way i can suppress those errors?

    and is there a limit on the amount of text a textbox can handle?
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  3. #3
    Addicted Member Martin Wilson's Avatar
    Join Date
    Mar 2002
    Location
    :)
    Posts
    236
    while ($rrow = mysql_fetch_array($rresult)) {
    Could it be the double r ?
    What is the answer to this question?

  4. #4

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    actually what i did is i doubled the r's just incase that might have been the problem. guess i forgot to take that one out before posting it here.

    still gives an error there though
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  5. #5
    scoutt
    Guest
    Originally posted by nabeels786
    and

    [code]Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 188

    Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\reviews\submit.php:11) in c:\inetpub\wwwroot\forums\includes\sessions.php on line 189]/code]


    its complaining about the <head> </head> portion of my thing, is there a way i can suppress those errors?

    and is there a limit on the amount of text a textbox can handle?
    it is not complaining about your head tags. it is complainging that you sent the header out already and you are trying to do it again. you must have something outputting text to the browser before you did something. the cod eyou have tehre will not do that. itis something else in your code. even a space after <? will messit up. are you useing a header() function anywhere? are you using a cookie anywhere?

    and why does everybody want to surpress the errors. if you get an error then your code will not run that is why the errors show up. duhhhhh!

    there is no limit a textbox can handle.

    it is getting an error because you got this

    $result = mysql_query($sql);
    while ($rrow = mysql_fetch_array($rresult)) {

    where is $rresult it does not exist.

  6. #6

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    i fixed up the double r's, still wont submit

    that missing header - it still loads the page and does everything fine. that peice of code is sending out a header, but i cant stop it from doing that cuz the cookies are needed

    the textbox thing - if i have text thats kinda long, and i click the submit button, it doesnt do anything. but if i take out a paragraph, then itll submit fine
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  7. #7
    scoutt
    Guest
    you will have to check for cookie or set one before you out put the headers.

    the text in the textbox is not your problem. what did you assign to the category you are submittin gto? text that has a limit to 255 but largetext I think will hold more. what is your cod enow as the one above should work.

  8. #8

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    Yes, I have it set to largetext as the type in the table.

    But when I click the submit button, nothing happens, but if i take some code out, then itll submit the code. if you want the whole php page, i can upload it

    PHP Code:
    $num mysql_num_rows(mysql_query("SELECT * FROM reviews"));
                                
    //echo $num-5;
                                
    if(($num-5)<=0){
                                    
    $sql "SELECT * FROM reviews LIMIT $num";
                                }
                                else{
                                    
    $sql "SELECT * FROM reviews LIMIT $num-5, 5";
                                }

                                
    $result mysql_query($sql);
                                while (
    $row mysql_fetch_array($result)) {
                                    
    printf("<li><a href=\"viewreview.php?id=%s&sys=%s\">%s</a></li>"$row['id'], $row['system'], $row['gamename']);
                                } 
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  9. #9
    scoutt
    Guest
    try this
    PHP Code:
    $num mysql_num_rows(mysql_query("SELECT * FROM reviews"));
                                
    //echo $num-5;
                                
    if(($num-5)<=0){
                                    
    $sql "SELECT * FROM reviews LIMIT $num";
                                }
                                else{
                                    
    $sql "SELECT * FROM reviews LIMIT $num-5, 5";
                                }

                                
    $result mysql_query($sql);
                               if (!
    $result){
                               echo 
    mysql_error($result)
                               }
                                while (
    $row mysql_fetch_array($result)) {
                                    
    printf("<li><a href=\"viewreview.php?id=%s&sys=%s\">%s</a></li>"$row['id'], $row['system'], $row['gamename']);
                                } 
    I add ing our little frined the error checker. I suggest using it all the time as it will help you a lot for debugging. if you don't need to debug it them just comment it out.

    and yes upload the page as thi spart will not stop you from submitting.

  10. #10

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    wow, its working now. i dont know what the problem was, i just copied and pasted what you wrote.
    weird


    you can see it from here

    http://fbgforums.jniv.net/reviews/index.php
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  11. #11
    scoutt
    Guest
    that is why that little error checker is your friend.

    cool.

  12. #12

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    im starting to like it more and more
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width