Sql help (Gallery)

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

    Sql help (Gallery)

    usage
    Code:
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery3"));
      echo "<br/><a href=\"index.php?action=pkgal&amp;sid=$sid\">Uploader Photo($noi[0])</a><br/>";
    index.php
    Code:
    else if($action=="pkgal")
    {
      addonline(getuid_sid($sid),"Users Gallery","index.php?action=$action");
     
    
     echo "<p align=\"left\">";
    
    echo "Users Gallery<br/>";
     $males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery3 WHERE sex='M'"));
    echo "<a href=\"lists.php?action=boys&amp;sid=$sid\">Boys Gallery($males[0])</a><br/>";
    $females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery3 WHERE sex='F'"));
    echo "<a href=\"lists.php?action=girls&amp;sid=$sid\">Girls Gallery($females[0])</a><br/>";
    echo "</p>";
     echo "<p align=\"center\">";
      echo "<a href=\"http://wap.net.ph/gallery2/upload.php?sid=$sid\">Uploader Photo via Device</a><br/>";
    echo "<a href=\"index.php?action=addgal&amp;sid=$sid\">Upload Photo via url</a><br/>";
     
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
    
    }
    else if($action=="addgal")
    {
       addonline(getuid_sid($sid),"Galleries","index.php?action=addgal");
        echo "<title>v2: Add Photos</title>";
       
       echo "<left>";
        echo "<b>Add PICS</b><br/><br/>";
        echo "<form action=\"genproc.php?action=addgal&amp;sid=$sid\" method=\"post\">";  
    echo "Image URL: <input name=\"itemurl\" type=\"text\" value=\"http://\"/><br/>";
    echo "<br/><input type=\"submit\" value=\"Add Photo\"/>";
    echo "</form>"; 
    
      echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\">";
      echo "Main menu</a>";
      echo "</p>";
    }
    index.php?action=viewuser
    Code:
     echo "<a href=\"lists.php?action=viewuser&amp;who=$who&amp;sid=$sid\">View gallery</a><br/>";
    genproc.php
    Code:
    else if($action=="delgal")
    {
    $gid = $_GET["gid"];
    echo "<title>Gallery</title>";
    echo "<p align=\"center\">";
    echo "<br/>";
    $res = mysql_query("DELETE FROM ibwf_gallery3 WHERE id='".$gid."'");
    if($res){
    echo "Deleted successfully";
    }else{
    echo ">Error! Please Try again!";
    }
    echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
    echo "</p>";
    }
    else if($action=="addgal")
    {
       $itemurl = $_POST["itemurl"];
    addonline(getuid_sid($sid),"Adding A Pic","index.php?action=main");
    
         echo "<p align=\"center\">";
     $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$who."'"));
      $uid = getuid_sid($sid);
      $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$uid."'"));
      if($nopl[0]=='M')
      {
        $usex = "M";
      }else if($nopl[0]=='F'){
        $usex = "F";
      }else{
        $usex = "M";
      }
       $res = mysql_query("INSERT INTO ibwf_gallery3 SET uid='".$uid."', itemurl='".$itemurl."', sex='".$usex."'");
          if($res)
          {
            echo "User Photo Added<br/>";
          }else{
            echo "Database Error<br/>";
          }
       
          echo "<a href=\"index.php?action=usergal&amp;sid=$sid&amp;browse?start\">User Gallery</a><br/>";
       echo "<a href=\"index.php?action=main&amp;sid=$sid&amp;type=send&amp;browse?start\">";
    echo "Main menu</a>";
      echo "</p>";
    
    }
    else if($action=="addcom2")
    {
        $text = $_POST["text"];
       $prate = $_POST["prate"];
    
      $gid = $_GET["gid"];
      addonline(getuid_sid($sid),"Adding Photo Comment","index.php?action=main");
       echo "<card id=\"main\" title=\"Add Photo\">";
          echo "<p align=\"center\">";
          $crdate = time();
          $uid = getuid_sid($sid);
          $res = false;
    
          if(trim($text)!="")
          {
            
          $res = mysql_query("INSERT INTO ibwf_galcom SET text='".$text."', byuser='".$uid."', time='".$crdate."', pid='".$gid."'");
          }
          if($res)
          {
            echo "Comment Added Successfully<br/>";
          }else{
            echo "Error Adding Comment<br/>";
          }
    if($prate!="") {
    $res2 = mysql_query("INSERT INTO ibwf_prate SET uid='".$uid."', pid='".$gid."', prate='".$prate."'");
        if($res2)
        {
            echo "Photo rated successfully<br/>";
        }else{
            echo "Database Error!<br/>";
        }
      }      
    
          
    echo "<a href=\"index.php?action=pkgal&amp;sid=$sid\">Users Gallery</a><br/>";
          echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main</a>";
          echo "</p>";
          echo "</body>";
    
    }
    lists.php
    Code:
    /////////////////////////////////////Comments
    else if($action=="comments2")
    {
        $who = $_GET["who"];
    $gid = $_GET["gid"];
        $whonick = getnick_uid($who);
     addonline(getuid_sid($sid),"Viewing Photo Comments of $whonick","lists.php?action=$action&amp;who=$who&amp;gid=$gid");
        addplace(getuid_sid($sid),"lists.php?action=$action&amp;who=$who&amp;gid=$gid","");
     echo "<title>Photo Comments</title>";
        $uid = getuid_sid($sid);
    
        //////ALL LISTS SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_galcom WHERE pid='".$gid."'"));
        $num_items = $noi[0]; //changable
        $items_per_page= 5;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    
           $sql = "SELECT id, pid, text, byuser, time FROM ibwf_galcom WHERE pid='".$gid."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";
    
    
        echo "<p>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
    
              if(isonline($item[3]))
      {
        $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
    
      }else{
        $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
      }
        $snick = getnick_uid($item[3]);
          $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[3]&amp;sid=$sid\">$iml$snick</a>:";
          $bs = date("d m y-H:i:s",$item[4]);
          echo "$lnk<br/><small>";
    
    $me = getuid_sid($sid);
    if($who=="$me") {
    $can = "a";
    }else{
    $can = "b";
    }
      if(ismod($uid)||$can=="a")
      {
       $delnk = "<a href=\"genproc.php?action=delcmt&amp;sid=$sid&amp;id=$item[0]\">[x]</a>";
          }else{
            $delnk = "";
          }
          $text = parsepm($item[2], $sid);
          echo "$text $delnk<br/>";
    echo "$bs";
    echo "<br/>";
          echo "</small>";
    
        }
        }
        echo "</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"lists.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">&#171;PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"lists.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">Next&#187;</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
        if($num_pages>2)
        {
    
            $rets .= "<form action=\"lists.php\" method=\"get\">";
          $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
            $rets .= "<input type=\"submit\" value=\"GO\"/>";
            $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
            $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
    
            $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
            $rets .= "</form>";
    
            echo $rets;
        }
        echo "</p>";
      ////// UNTILL HERE >>
        echo "<p align=\"center\">";
       $me = getuid_sid($sid);
    if($me!="$who") {
        echo "<a href=\"index.php?action=addcom&amp;sid=$sid&amp;who=$who&amp;gid=$gid\">Add Comment</a><br/>";
    }
    
    echo "<a href=\"index.php?action=usergal&amp;sid=$sid\">User Gallery</a><br/>";
        echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
      echo "</p>";
    
    }
    /////////////////////////////////////Gwapos
    else if($action=="boys")
    {
          addonline(getuid_sid($sid),"Viewing Boys Gallery","lists.php?action=$action");
          addplace(getuid_sid($sid),"lists.php?action=$action","lists.php?action=$action");
    
        $uid = getuid_sid($sid);
    
    
    
        //////ALL gallery SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
    
    
        if($who!="")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery3 WHERE sex='M'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery3 WHERE sex='M'"));
        }
    
        $num_items = $noi[0]; //changable
        $items_per_page= 8;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    $sql = "SELECT DISTINCT uid FROM ibwf_gallery3 WHERE sex='M' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
    
     echo "<p><small>";
        $items = mysql_query($sql);
        echo mysql_error();
    
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
    $who = $item[0];
    $user=getnick_uid($who);
    
    $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery3 WHERE uid='".$who."'"));
            $lnk = "<a href=\"lists.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a><br/>";
           echo "$lnk";
       }
        }else{
    echo "Boys gallery is empty";
    }
        echo "</small></p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"lists.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"lists.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
       if($num_pages>2)
        {
            $rets = "<form action=\"lists.php\" method=\"get\">";
          $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
            $rets .= "<input type=\"submit\" value=\"GO\"/>";
            $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
            $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
            $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
            $rets .= "</form>";
    
    
            echo $rets;
        }
       $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
            $pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
            $unrd="".$unreadinbox[0]."";
            if ($unreadinbox[0]>0)
            {
            echo "<a href=\"inbox.php?action=main&amp;sid=$sid&amp;type=send\">$unrd new pm</a>";
          }
    echo "<br/><a href=\"index.php?action=pkgal&amp;sid=$sid\">User Gallery</a><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main menu</a>";
        echo "</p>";
    
        echo "</body>";
    
    }
    /////////////////////////////////////Gwapas
    else if($action=="girls")
    {
         addonline(getuid_sid($sid),"Viewing Girls Gallery","lists.php?action=$action");
         addplace(getuid_sid($sid),"lists.php?action=$action","lists.php?action=$action");
    
        $uid = getuid_sid($sid);
    
    
        //////ALL gallery SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($who!="")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery3 WHERE sex='F'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery3 WHERE sex='F'"));
        }
    
        $num_items = $noi[0]; //changable
        $items_per_page= 8;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
    $sql = "SELECT DISTINCT uid FROM ibwf_gallery3 WHERE sex='F' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
    
     echo "<p><small>";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
    $who = $item[0];
    $user=getnick_uid($who);
    $countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery3 WHERE uid='".$who."'"));
            $lnk = "<a href=\"lists.php?action=viewuser&amp;who=$who&amp;sid=$sid\">$user($countpics[0])</a><br/>";
    
     echo "$lnk";
    
        }
        }else{
    echo "Girls gallery is empty";
    }
        echo "</small></p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"lists.php?action=$action&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"lists.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
         if($num_pages>2)
        {
            $rets = "<form action=\"lists.php\" method=\"get\">";
          $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
            $rets .= "<input type=\"submit\" value=\"GO\"/>";
            $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
            $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
            $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
            $rets .= "</form>";
    
    
            echo $rets;
        }
       $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
            $pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
            $unrd="".$unreadinbox[0]."";
            if ($unreadinbox[0]>0)
            {
            echo "<a href=\"inbox.php?action=main&amp;sid=$sid&amp;type=send\">$unrd New MSG</a>";
          }
    echo "<br/><a href=\"index.php?action=pkgal&amp;sid=$sid\">Users Gallery</a><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "Main</a>";
        echo "</p>";
    
        echo "</body>";
    }
    /////////////////////////////////////all gal
    else if($action=="viewuser")
    {
          $who = $_GET["who"];
        $whonick = getnick_uid($who);
        addonline(getuid_sid($sid),"Viewing Photos of $whonick","lists.php?action=$action&amp;who=$who");
         addplace(getuid_sid($sid),"lists.php?action=$action&amp;who=$who","");
    
        $uid = getuid_sid($sid);
    
    
    
        //////ALL gallery SCRIPT <<
    
        if($page=="" || $page<=0)$page=1;
        if($who!="")
        {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery3 WHERE uid='".$who."'"));
        }else{
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery3"));
        }
        $num_items = $noi[0]; //changable
        $items_per_page= 1;
        $num_pages = ceil($num_items/$items_per_page);
        if(($page>$num_pages)&&$page!=1)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
    
        if($who!="")
        {
            $sql = "SELECT id, sex, itemurl FROM ibwf_gallery3 WHERE uid='".$who."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";
            }else{
    $sql = "SELECT id, sex, itemurl, uid FROM ibwf_gallery3  ORDER BY id DESC LIMIT $limit_start, $items_per_page";
            }
    
    echo "<p align=\"center\">";
        $items = mysql_query($sql);
        echo mysql_error();
        if(mysql_num_rows($items)>0)
        {
        while ($item = mysql_fetch_array($items))
        {
          $id = $item[0];
            $img = $item[2];
    
    
            $lnk = "<img src=\"$img\" alt=\"$id\" width=\"100\" height=\"80\"/><br/>";
        $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM ibwf_prate WHERE pid='".$id."'"));
    $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE pid='".$id."'"));
    if($counts[0]>0) {
        $ther = $rinfo[1]/$rinfo[0];
        $rating = "Rating: $ther/$rinfo[1] votes <b>($counts[0])</b><br/>";
    }else{
    $rating = "";
    }
    
             $gall = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_galcom WHERE pid='".$id."'"));
    $me = getuid_sid($sid);
    if($who=="$me") {
    $use = "<a href=\"genproc.php?action=upav2&amp;sid=$sid&amp;gid=$item[0]\">Use as Avatar</a> | ";
    }else{
    $use = "";
    }
          if(candelgal($uid, $item[0]))
          {
            $delnk = "<a href=\"genproc.php?action=delgal&amp;sid=$sid&amp;gid=$item[0]\">Remove Photo</a>";
          }else{
            $delnk = "";
          }
          echo "$lnk$rating<a href=\"$img\">Download</a><br/> $use$delnk<br/><a href=\"lists.php?who=$who&amp;action=comments2&amp;sid=$sid&amp;gid=$item[0]\">Comments($gall[0])</a><br/>";
    
    
        }
        }
        echo "</p>";
    echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"lists.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"lists.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
        }
        echo "<br/>$page/$num_pages<br/>";
         if($num_pages>2)
        {
            $rets = "<form action=\"lists.php\" method=\"get\">";
          $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
            $rets .= "<input type=\"submit\" value=\"GO\"/>";
            $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
            $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
            $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
            $rets .= "</form>";
    
    
            echo $rets;
        }
    
    echo "<a href=\"index.php?action=pkgal&amp;sid=$sid\">Users Gallery</a><br/>";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main menu</a>";
    
        echo "</p>";
        echo "</body>";
    
    }
    who can help me to make the sql ibwf_prate and ibwf_galcom
    Code:
    -- Table structure for table `ibwf_gallery3`
    --
    
    CREATE TABLE IF NOT EXISTS `ibwf_gallery3` (
      `id` int(11) NOT NULL DEFAULT '0',
      `uid` int(11) NOT NULL DEFAULT '0',
      `sex` text NOT NULL,
      `itemurl` int(11) NOT NULL DEFAULT '0'
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Dumping data for table `ibwf_gallery3`
    --
    l
    Last edited by riderz; 29.09.09, 17:35.

    #2
    ok ive made this but now the images dnt display
    Code:
    --
    -- Table structure for table `ibwf_prate`
    --
    
    CREATE TABLE IF NOT EXISTS `ibwf_prate` (
      `id` int(100) NOT NULL AUTO_INCREMENT,
      `blogid` int(100) NOT NULL DEFAULT '0',
      `uid` int(100) NOT NULL DEFAULT '0',
     `pid` int(100) NOT NULL DEFAULT '0',
      `prate` char(1) NOT NULL DEFAULT '',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2095 ;
    
    --
    -- Dumping data for table `ibwf_prate`
    --
    -- Table structure for table `ibwf_galcom`
    --
    
    CREATE TABLE IF NOT EXISTS `ibwf_galcom` (
      `id` int(11) NOT NULL DEFAULT '0',
      `uid` int(11) NOT NULL DEFAULT '0',
       `pid` int(100) NOT NULL DEFAULT '0'
     `text' blob NOT NULL,
     `byuser` int(100) NOT NULL DEFAULT '0'
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Dumping data for table `ibwf_galcom`
    --
    Last edited by riderz; 29.09.09, 17:58.

    Comment


      #3
      this is what i use on mine
      Code:
      -- 
      -- Table structure for table `ibwf_prate`
      -- 
      CREATE TABLE `ibwf_prate` (
        `id` int(100) NOT NULL auto_increment,
        `pid` int(100) NOT NULL default '0',
        `uid` int(100) NOT NULL default '0',
        `prate` char(10) NOT NULL default '',
        PRIMARY KEY  (`id`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
      -- 
      -- Dumping data for table `ibwf_prate`
      --
      Code:
      -- 
      -- Table structure for table `ibwf_galcomments`
      -- 
      CREATE TABLE `ibwf_galcomments` (
        `id` int(99) NOT NULL auto_increment,
        `pid` int(99) NOT NULL default '0',
        `text` varchar(200) NOT NULL default '',
        `byuser` varchar(100) NOT NULL default '',
        `time` varchar(99) NOT NULL default '',
        PRIMARY KEY  (`id`),
        UNIQUE KEY `text` (`text`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
      -- 
      -- Dumping data for table `ibwf_galcomments`
      --

      Comment


        #4
        change auto_increment to 1 it will work

        Originally posted by riderz View Post
        ok ive made this but now the images dnt display
        Code:
        --
        -- Table structure for table `ibwf_prate`
        --
        
        CREATE TABLE IF NOT EXISTS `ibwf_prate` (
          `id` int(100) NOT NULL AUTO_INCREMENT,
          `blogid` int(100) NOT NULL DEFAULT '0',
          `uid` int(100) NOT NULL DEFAULT '0',
         `pid` int(100) NOT NULL DEFAULT '0',
          `prate` char(1) NOT NULL DEFAULT '',
          PRIMARY KEY (`id`)
        ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2095 ;
        
        --
        -- Dumping data for table `ibwf_prate`
        --
        -- Table structure for table `ibwf_galcom`
        --
        
        CREATE TABLE IF NOT EXISTS `ibwf_galcom` (
          `id` int(11) NOT NULL DEFAULT '0',
          `uid` int(11) NOT NULL DEFAULT '0',
           `pid` int(100) NOT NULL DEFAULT '0'
         `text' blob NOT NULL,
         `byuser` int(100) NOT NULL DEFAULT '0'
        ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
        
        --
        -- Dumping data for table `ibwf_galcom`
        --
        E107 Security Team Leader
        Proudly Support AccountLab Plus Billing Software

        Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com
        ------------------

        Comment


          #5
          from when io briefly look over it yesterday and was speaking to u i couldnt actully see an image source in there
          Want something coded email me at sales@webnwaphost.com for a prices.




          Comment


            #6
            yea i see also it give link like this

            http://site.com/0 so it dnt fetch the image from correct place

            Comment


              #7
              who can help me with this part this part are suppose to show the image but it doesnt
              Code:
               if(mysql_num_rows($items)>0)
                  {
                  while ($item = mysql_fetch_array($items))
                  {
                    $id = $item[0];
                      $img = $item[2];
              
              
                      $lnk = "<img src=\"$img\" alt=\"$id\" width=\"100\" height=\"80\"/><br/>";
                  $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM ibwf_prate WHERE pid='".$id."'"));
              $counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE pid='".$id."'"));
              if($counts[0]>0) {
                  $ther = $rinfo[1]/$rinfo[0];
                  $rating = "Rating: $ther/$rinfo[1] votes <b>($counts[0])</b><br/>";
              }else{
              $rating = "";
              }

              Comment


                #8
                the $lnk part is the photo if its grabbing i from the right place...

                echo "$lnk"; will show the photo, but we cant see if your already doing that because it looks like a few lines of a whole file

                Comment


                  #9
                  can anyone repost the sql of that ibwf_galcom cause theres an error when i put in my phpmyadmin thanks

                  Comment


                    #10
                    the mistake is not in the sql, bro. I had the same problem, but i corrected it. I must know in which directory are your images being uploaded. So, in the upload.php (or where the sql updates are being done), modify the code, so, let be updated only the filename. Then, change the src image to <img src=\"(the-images-dir)/$filename\">
                    mysterio.al - programming is a functional art

                    Comment

                    Working...
                    X