Unable to jump to row 0

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • arnage
    replied
    Cool, if that works for you ok... Set error_reporting(E_ALL); to see the errors.

    Leave a comment:


  • tzapone
    replied
    PHP Code:
    if($komm_list)
    {
        
    $k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `statuse_komm` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);
        
    $k_page=k_page($k_post,$set['p_str']);
        
    $page=page($k_page);
        
    $start=$set['p_str']*$page-$set['p_str'];
        
    $q=mysql_query("SELECT * FROM `statuse_komm` WHERE `id_statuse` = '".intval($_GET['id'])."' ORDER BY `time` ASC LIMIT $start$set[p_str]");
        if(
    mysql_num_rows(mysql_query("SELECT * FROM `statuse_like` WHERE `id_statuse`='".intval($_GET['id'])."'"))!=0)
        {
            
    $kim=mysql_result(mysql_query("SELECT COUNT(*) FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);
            
    $kum=mysql_result(mysql_query("SELECT `id_user` FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);

            
    $kom=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `id`='$kum' LIMIT 1"),0);
        }
        else
            
    $kim=0;

        
    //$q=mysql_query("SELECT * FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
        ////
        
    $kem=$kim-1;
        if(
    $kim==0){
            echo 
    "<div class='p_t'>\n";
            echo 
    "Nobody like the status.";
            echo 
    "</div>";
        }
        elseif(
    $kim==1){
            echo 
    "<div class='p_t'>\n";
            echo 
    "<img src='status/suka.gif'> <a href='/info.php?id=$kum'>$kom</a> like status.";
            echo 
    "</div>";
        }
        elseif(
    $kim>=2){
            echo 
    "<div class='p_t'>\n";
            echo 
    "<img src='status/suka.gif'> <a href='/info.php?id=$kum'>$kom</a> and <a href='status/like_all.php?id=".$statuse['id']."'>$kem altii</a> like status.";
            echo 
    "</div>";
        }
        echo 
    "</div>"
    i put this code and no more errors :D thanks for the help.

    Leave a comment:


  • kevk3v
    replied
    I still think no data is being returned, he said "Another thing is that when i give a like or somebody like the status , the error don;t appear anymore. Error appear when nobody like the status"

    Leave a comment:


  • arnage
    replied
    Globals must be checked is isset for example with

    PHP Code:
    $id = isset($_GET['id']) ? abs(intval($_GET['id'])) : ''// right way (with abs() added) 
    ... otherwise it returns 0 like this,

    PHP Code:
    $id intval($_GET['id']); // wrong way and Notice undefinied index 
    ... but he says he tried to change that in all lines and still getting the same error.

    Leave a comment:


  • kevk3v
    replied
    Originally posted by subzero View Post
    Do this

    $to-get-id = intval($_GET['id']);

    (*) FROM `statuse_komm` WHERE `id_statuse` = '".$to-get-id."'"),0);

    Might be the problem..

    Self closing to nothing.
    $to-get-id is an invalid variable should be something like $to_get_id

    The reason is the minus sign (-) because its a php operator.

    Added after 12 minutes:

    This sounds like the no data is being returned,
    try this

    PHP Code:
    <?php

    $id 
    = isset($_GET['id']) ? abs(intval($_GET['id'])) : ''// arnage 
    $sql "SELECT `id_user` FROM `statuse_like` WHERE `id_statuse` = '$id'";
    $query mysql_query($sql) or die ("Could not get data because ".mysql_error());
    $num_rows mysql_num_rows($query);

    if (
    $num_rows>0) {
        echo 
    "rows found";
        } else {
        echo 
    "no rows found";
    }

    if(empty(
    intval($_GET['id']))
    {
    echo 
    ', the problem is $_GET["id"]...';
    }

    ///tell us the output of this...

    ?>
    Last edited by kevk3v; 03.03.13, 10:41.

    Leave a comment:


  • subzero
    replied
    Something might be stupid thing like

    (*) FROM `statuse_komm` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);

    Do this

    $to-get-id = intval($_GET['id']);

    (*) FROM `statuse_komm` WHERE `id_statuse` = '".$to-get-id."'"),0);

    Might be the problem..

    Self closing to nothing.

    Leave a comment:


  • arnage
    replied
    I have no other idea.

    Leave a comment:


  • tzapone
    replied
    same error

    Leave a comment:


  • arnage
    replied
    Originally posted by tzapone View Post
    Warning: Wrong parameter count for mysql_result() in /home/wapcomun/public_html/list.php on line 217

    Warning: Wrong parameter count for mysql_result() in /home/wapcomun/public_html/list.php on line 219


    Added after 5 minutes:



    i have the same error. Another thing is that when i give a like or somebody like the status , the error don;t appear anymore. Error appear when nobody like the status and appear only to staff memebers
    You need to change it everywhere, and this things $statuse[id] like this $statuse['id'] or $statuse["id"].

    And set sql rows if its NOT NULL with DEFAULT ''
    Last edited by arnage; 02.03.13, 09:16.

    Leave a comment:


  • subzero
    replied
    You need to end tag the 0

    Like

    PHP Code:
    ,0); 
    To

    PHP Code:
    ,'0'); 

    Leave a comment:


  • tzapone
    replied
    Originally posted by something else View Post
    what happens when you remove the ,0 from both lines?
    Warning: Wrong parameter count for mysql_result() in /home/wapcomun/public_html/list.php on line 217

    Warning: Wrong parameter count for mysql_result() in /home/wapcomun/public_html/list.php on line 219


    Added after 5 minutes:

    Originally posted by arnage View Post
    This intval($_GET['id'] sets the first query to 0, so try changing it to:

    PHP Code:
    $id = isset($_GET['id']) ? abs(intval($_GET['id'])) : ''// This should be used for every global var

    $kum=mysql_result(mysql_query("SELECT `id_user` FROM `statuse_like` WHERE `id_statuse` = '".$id."'"),0);

    $kom=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `id`='$kum' LIMIT 1"),0); 
    i have the same error. Another thing is that when i give a like or somebody like the status , the error don;t appear anymore. Error appear when nobody like the status and appear only to staff memebers
    Last edited by tzapone; 01.03.13, 19:33.

    Leave a comment:


  • arnage
    replied
    This intval($_GET['id'] sets the first query to 0, so try changing it to:

    PHP Code:
    $id = isset($_GET['id']) ? abs(intval($_GET['id'])) : ''// This should be used for every global var

    $kum=mysql_result(mysql_query("SELECT `id_user` FROM `statuse_like` WHERE `id_statuse` = '".$id."'"),0);

    $kom=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `id`='$kum' LIMIT 1"),0); 

    Leave a comment:


  • something else
    replied
    what happens when you remove the ,0 from both lines?

    Leave a comment:


  • tzapone
    started a topic Unable to jump to row 0

    Unable to jump to row 0

    Hello guys, i have a problem on my site.
    PHP Code:
    if($komm_list)
    {
    $k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `statuse_komm` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);
    $k_page=k_page($k_post,$set['p_str']);
    $page=page($k_page);
    $start=$set['p_str']*$page-$set['p_str'];
    $q=mysql_query("SELECT * FROM `statuse_komm` WHERE `id_statuse` = '".intval($_GET['id'])."' ORDER BY `time` ASC LIMIT $start$set[p_str]");
    $ank=get_user($post['id_user']);
    $kim=mysql_result(mysql_query("SELECT COUNT(*) FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);
    $kum=mysql_result(mysql_query("SELECT `id_user` FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);

    $kom=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `id`='$kum' LIMIT 1"),0);
    ////
    //$q=mysql_query("SELECT * FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."' ORDER BY `id` DESC LIMIT $start, $set[p_str]");
    ////
    $kem=$kim-1;
    if(
    $kim==1){
    echo 
    "<div class='p_t'>\n";
    echo 
    "<img src='status/suka.gif'> <a href='/info.php?id=$kum'>$kom</a> like statuse.";
    echo 
    "</div>";
    }
    elseif(
    $kim>=2){
    echo 
    "<div class='p_t'>\n";
    echo 
    "<img src='status/suka.gif'> <a href='/info.php?id=$kum'>$kom</a> and <a href='status/like_all.php?id=".$statuse['id']."'>$kem altii</a> like statuse.";
    echo 
    "</div>";
    }
    echo 
    "</div>";
    while (
    $post mysql_fetch_assoc($q))
    {
    //$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
    $ank=get_user($post['id_user']);

    echo 
    "<div class='p_t'>\n";
    //echo "<a href='/info.php?id=$ank[id]'><span style=\"color:$ank[ncolor]\">$ank[nick]</span></a>\n";
    user($ank['id']);
    //echo "<a href='info.php?id=$ank[id]'><b>".status($ank['id'])."<span style=\"color:$ank[ncolor]\">$ank[nick]</span></b></a>";
    //echo "".medal($ank['id'])." ".online($ank['id'])." ";
    echo "<span style=\"color:$ank[mcolor]\">";
    echo 
    "".output_text($post['msg'])."";
    echo 
    "</span>\n";
    echo 
    "<br /><font class='time'>".waktu($post['time'])."</font></span>\n";

    if (isset(
    $user) && ($user['level']>=4) || isset($user) && ($user['id'] == $statuse['id_user']))
    echo 
    "<a href='?id=".intval($_GET['id'])."&amp;del=$post[id]'> Delete</a><br />\n";
    echo 
    "</div>";
    }


    if (
    $k_page>1)str("?id=".intval($_GET['id']).'&amp;',$k_page,$page);
    //Form komentar

    echo"<div class='p_t'>\n";
    if (isset(
    $user))

    {echo 
    "<form method=\"post\" name='message' action=\"?id=".intval($_GET['id'])."&amp;page=$page\">\n";
    if (
    $set['web'] && is_file(H.'style/themes/'.$set['set_them'].'/altername_post_form.php'))
    include_once 
    H.'style/themes/'.$set['set_them'].'/altername_post_form.php';
    else
    /*echo "<div>";
    echo "<form method=\"post\" name='message' action=\"?\">\n";
    echo "<table cellspacing=\"0\" cellpadding=\"0\" class=\"comboInput\"><tr><td class=\"inputCell\">";
    echo "Add a p_t";
    echo "<br />\n<textarea name=\"msg\" rows=\"3\" cols=\"13\"></textarea></td><td>\n";
    echo "<input class=\"btn btnC\" value=\"Comment\" type=\"submit\"/></td></tr></table></div>\n";
    echo "</form></div>\n";*/
    echo "<div id=\"body\">Adaugi comentariu?<form method=\"post\" id=\"composer_form\" name=\"message\" action=\"?\"><table class=\"comboInput\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"inputCell\"><textarea class=\"input composerInput\" name=\"msg\" rows=\"2\" cols=\"15\"></textarea></td><td><input value=\"Comment\" class=\"btn btnC\" type=\"submit\"></td></tr></tbody></table></div></form></div>";
    }
    }
    else
    {
    echo
    "<a href='komm.php?id=$statuse[id]'>&raquo;Comment</a> (".mysql_result(mysql_query("SELECT COUNT(*) FROM `statuse_komm` WHERE `id_statuse` = '$statuse[id]'"),0).")<br/>";

    the error is here but i can't fix it.
    $kum=mysql_result(mysql_query("SELECT `id_user` FROM `statuse_like` WHERE `id_statuse` = '".intval($_GET['id'])."'"),0);

    $kom=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `id`='$kum' LIMIT 1"),0);


    and this is the message:
    Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 78 in /home/wapcomun/public_html/sper/list.php on line 214

    Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 79 in /home/wapcomun/public_html/sper/list.php on line 216
    Last edited by tzapone; 01.03.13, 12:12.
Working...
X