Unable to jump to row 0

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

  • tzapone
    replied
    thanks :D but now i have another problem . Not an error , but i don't like how the code works:
    PHP Code:
    $q1=mysql_query("SELECT * FROM `banned_word`");
    while (
    $spam mysql_fetch_assoc($q1))
    {
    $str=str_replace($spam['text'],$spam['word'],$str);

    I want to make a spam detection, i put in db a word like : mama and should appear m*m* . Untill now is perfect, but when i write mamamia appera m*m*mia. How to change the code to appear the word mamamia corect? without spam filter.

    Leave a comment:


  • something else
    replied
    A "like" for finding out the answer yourself

    Leave a comment:


  • tzapone
    replied
    PHP Code:
    $k_post=mysql_fetch_row(mysql_query("SELECT COUNT(*)FROM`user`WHERE`ank_d_r`='$currD'&&`ank_m_r`='$currm'",$db));
    $k_post=$k_post[0];
    $k_bday=mysql_fetch_row(mysql_query("SELECT`nick`FROM`user`WHERE`ank_d_r`='$currD'&&`ank_m_r`='$currm' LIMIT 1"));
    $k_bday=$k_bday[0];
    $bday=mysql_fetch_row(mysql_query("SELECT`id`FROM`user`WHERE`ank_d_r`='$currD'&&`ank_m_r`='$currm' LIMIT 1"));
    $bday=$bday[0]; 
    i put like this and it work. Sorry for the topic. You cand delete or close.

    Leave a comment:


  • tzapone
    started a topic Unable to jump to row 0

    Unable to jump to row 0

    PHP Code:
    $currD=date("d"time());
    $currm=date("m"time());

    $k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm'",$db), 0);
    $k_bday=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm' LIMIT 1 "),0);
    $bday=mysql_result(mysql_query("SELECT `id` FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm' LIMIT 1 "),0);

    $sisa=$k_post-1;

    echo 
    '<div class="p_t2">';


    if(
    $k_post==0){
    echo 
    "";
    }


    if(
    $k_post==1){
    echo 
    "<table class='notif' width='100%'><tr><td width='2%'><img src='/style/icons/ultah.png'> <a href='/info.php?id=$bday'>$k_bday</a> sarbatoreste azi ziua de nastere</td></tr></table>";
    }
    if(
    $k_post>=2){
    echo 
    "<table class='notif' width='100%'><tr><td width='2%'><img src='/style/icons/ultah.png'> <a href='/info.php?id=$bday'>$k_bday</a> si <a href='/list_bday.php?SESS=$sess'> inca $sisa </a> sarbatoresc azi data nasterii </td></tr></table>";


    i received 2 errors in lines:

    PHP Code:
    $k_bday=mysql_result(mysql_query("SELECT `nick` FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm' LIMIT 1 "),0);
    $bday=mysql_result(mysql_query("SELECT `id` FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm' LIMIT 1 "),0); 
    what is wrong in this code?
Working...
X