SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with an error in dating script

    Need help trying to troubleshoot an error in a dating script I'm using.

    Unfortunately the company that made it has gone Chapter 11. And while I search for a new solution I need to fix the bug before my users all flee!

    The error is occurring when they try to send messages--pretty important part of a dating site!!

    Here's the error:
    Code:
    [FONT='Verdana','sans-serif']Inbox Sent messages From Warning: mysql_num_rows(): supplied argument is not a  valid MySQL result resource in  C:\Inetpub\vhosts\powwows.com\httpdocs\esnag\message.php on line 41 Your Inbox  list is empty Warning: mysql_fetch_array(): supplied argument is not a valid  MySQL result resource in  C:\Inetpub\vhosts\powwows.com\httpdocs\esnag\message.php on line 43  [/FONT]
    Here is the code from that file.

    Code:
       if(mysql_num_rows ($queryi) || mysql_num_rows ($query)) { } 
                        else { echo "<tr  bgcolor=\"#FFFFFF\"><td colspan=5  align=center>".$lang['EmptyInbox']."</td></tr>"; }
                        while ($rowi = mysql_fetch_array($queryi))  
                                  {
                                           $cand=date ("d/m/y -  h:i:s A",$rowi["post"]+$tdif);
                                           echo "<tr  bgcolor=\"#FAFAFA\">";
                                           echo  "<td><input type=\"checkbox\" name=\"ti[".$rowi["mail"]."]\"  value=\"".$rowi["mail"]."\"></td>";
                                           echo  "<td></td>";
                                           echo "<td><a  href=\"message.php?mesaj=".$rowi["mail"]."&where=1\">  ".$rowi["from_nick"]."</a> -$cand <img src=img/new$edlc.gif  border=0></td>";
                                           echo "<td><a  href=\"buddy.php?addbuddy=".$rowi["fromID"]."&name=".$rowi["from_nick"]."\"  target=\"bLayer\" alt=\"$lang[Add] $rowi[from_nick]  $lang[InBuddyList]\">Buddy</a></td>";
                                           echo "<td><a  href=\"buddy.php?bloc=".$rowi["fromID"]."&stare=0\"  target=\"bLayer\">ignore</a></td>";
                                           echo  "</tr>";
                                  }
    Thanks for the help!

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm i can guess that there is some problem in your query so that is not returing any resource/result in ($queryi and $query). so please check in your query for both of the resources or post them here with table structure so that experts can see and give solution.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok here is more of the code. Is this what you needed?

    Code:
    function AfisTitluri($ID)
    {
        global $where,$lang,$edlc,$set,$_COOKIE;
        $tdif=$set["serverTimeZone"]-($_COOKIE["tz"]*60*60);
        if($where!=3)
        {
            $queryi=mysql_query("SELECT mail,from_nick,fromID,post FROM imail WHERE to_ID=$ID ORDER BY post DESC");
            $query=mysql_query("SELECT mail,from_nick,fromID,post,reply FROM mail WHERE to_ID=$ID ORDER BY post DESC") or die(mysql_error());
    
                echo "<form name=\"del\" method=\"post\" action=\"message.php\">";    
                echo "<table align=\"center\" width='90%'>";
                echo "<tr><td colspan=7><table width='100%'><tr><td><input type=\"submit\" name=\"del\" value=\"$lang[Delete]\"></td><td align='right'>";
                ?>
                  <select name="m1">
                    <option value="message.php" selected><?php echo $lang['Inbox']?></option>
                    <option value="message.php?where=3"><?php echo $lang['SentMessages']?></option>
                  </select>
                   <input type="button" name="Button1" value="Go" onClick="eval('self.location=\''+self.document.del.m1.options[self.document.del.m1.selectedIndex].value+'\'');">
                <?php
                echo "</td></tr></table></td></tr><tr bgColor='#CCCCCC' height='20'><td colspan=2>&nbsp;</td><td><b>$lang[From]</b></td><td>&nbsp;</td><td colspan=2></td></tr>";
        
            if(mysql_num_rows ($queryi) || mysql_num_rows ($query)) { } 
            else { echo "<tr bgcolor=\"#FFFFFF\"><td colspan=5 align=center>".$lang['EmptyInbox']."</td></tr>"; }
            while ($rowi = mysql_fetch_array($queryi)) 
                {
                    $cand=date ("d/m/y - h:i:s A",$rowi["post"]+$tdif);
                    echo "<tr bgcolor=\"#FAFAFA\">";
                    echo "<td><input type=\"checkbox\" name=\"ti[".$rowi["mail"]."]\" value=\"".$rowi["mail"]."\"></td>";
                    echo "<td></td>";
                    echo "<td><a href=\"message.php?mesaj=".$rowi["mail"]."&where=1\"> ".$rowi["from_nick"]."</a> -$cand <img src=img/new$edlc.gif border=0></td>";
                    echo "<td><a href=\"buddy.php?addbuddy=".$rowi["fromID"]."&name=".$rowi["from_nick"]."\" target=\"bLayer\" alt=\"$lang[Add] $rowi[from_nick] $lang[InBuddyList]\">Buddy</a></td>";
                    echo "<td><a href=\"buddy.php?bloc=".$rowi["fromID"]."&stare=0\" target=\"bLayer\">ignore</a></td>";
                    echo "</tr>";
                }
            
            while ($row = mysql_fetch_array($query)) 
                {
                    $cand=date ("d/m/y - H:i",$row["post"]+$tdif);
                    echo "<tr bgcolor=\"#FAFAFA\">";
                    echo "<td width='8%'><input type=\"checkbox\" name=\"t[".$row["mail"]."]\" value=\"".$row["mail"]."\"></td>";
                    if($row["reply"]) $rep="<img src='img/reply.gif' border='0'>"; else $rep="";
                    echo "<td width='7%'>$rep</td>";
                    echo "<td width='75%'><a href=\"message.php?mesaj=".$row["mail"]."&where=0\"> ".$row["from_nick"]."</a> -$cand</td>";
                    echo "<td width='5%'><a href=\"buddy.php?addbuddy=".$row["fromID"]."&name=".$row["from_nick"]."\" target=\"bLayer\" alt=\"$lang[Add] $rowi[from_nick] $lang[InBuddyList]\">Buddy</a></td>";
                    echo "<td width='5%'><a href=\"buddy.php?bloc=".$row["fromID"]."&stare=0\" target=\"bLayer\">ignore</a></td>";        //window.location.href = 'test.htm?rightFrame'";
                    echo "</tr>";
                }
                echo "<tr><td colspan=7><table width='100%'><tr><td><input type=\"submit\" name=\"del\" value=\"$lang[Delete]\"></td><td align='right'>";
                ?>
                  <select name="m2">
                    <option value="message.php" selected><?php echo $lang['Inbox']?></option>
                    <option value="message.php?where=3"><?php echo $lang['SentMessages']?></option>
                  </select>
                   <input type="button" name="Button2" value="Go" onClick="eval('self.location=\''+self.document.del.m2.options[self.document.del.m2.selectedIndex].value+'\'');">
                <?php
                echo "</td></tr></tabel></td></tr></table></form>";
        }
        else
        {
            $query=mysql_query("SELECT mail,to_nick,to_ID,post FROM smail WHERE fromID=$ID ORDER BY post DESC") or die(mysql_error());
        
                echo "<form name=\"del\" method=\"post\" action=\"message.php\"><table width='90%' align=\"center\">";
                echo "<tr><td><input type=\"submit\" name=\"del\" value=\"$lang[Delete]\"></td><td align='right'>";
                ?>
                  <select name="m3">
                    <option value="message.php"><?php echo $lang['Inbox']?></option>
                    <option value="message.php?where=3" selected><?php echo $lang['SentMessages']?></option>
                  </select>
                   <input type="button" name="Button3" value="Go" onClick="eval('self.location=\''+self.document.del.m3.options[self.document.del.m3.selectedIndex].value+'\'');">
                <?php
                echo "<td></tr><tr bgColor='#CCCCCC' height='20'><td></td><td><b>$lang[SentTo]</b></td></tr>";
    
                if(mysql_num_rows ($query)) { 
                    while ($r = mysql_fetch_array($query)) 
                    {
                        $cand=date ("d/m/y - h:i:s A",$r["post"]+$tdif);
                        echo "<tr bgcolor=\"#FAFAFA\">";
                        echo "<td><input type=\"checkbox\" name=\"ts[".$r["mail"]."]\" value=\"".$r["mail"]."\"></td>";
                        echo "<td width='90%'><a href=\"message.php?mesaj=".$r["mail"]."&where=$where\"> ".$r["to_nick"]."</a> -$cand </td>";
                        echo "</tr>";
                    }
                } else { echo "<tr bgcolor=\"#FFFFFF\" height=32><td colspan=5 align=center>".$lang['EmptySent']."</td></tr>"; }
                
                echo "<tr><td><input type=\"submit\" name=\"del\" value=\"$lang[Delete]\"></td><td align='right'>";
                ?>
                  <select name="m4">
                    <option value="message.php"><?php echo $lang['Inbox']?></option>
                    <option value="message.php?where=3" selected><?php echo $lang['SentMessages']?></option>
                  </select>
                   <input type="button" name="Button4" value="Go" onClick="eval('self.location=\''+self.document.del.m4.options[self.document.del.m4.selectedIndex].value+'\'');">
                <?php
                echo "</td></tr></table><input type='hidden' name='where' value='$where'></form>";
        }
    }

  4. #4
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok found the problem! I was going to get the table structure. And that table has crashed.

    I tried to repair it and can't get it back. Any suggestions?

  5. #5
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pgowder View Post
    Ok found the problem! I was going to get the table structure. And that table has crashed.

    I tried to repair it and can't get it back. Any suggestions?
    Got it!!

    Thanks


Bookmarks

Posting Permissions

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