Sql help (Gallery)

Started on the old forum in September 2009 · view the original in the archive · old links redirect here

9 replies · 473 views · started 17 years ago · 6 min read

7 participants
riderz Lead · 975 posts #1

usage

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery3"));
  echo "<br/><a href=\"index.php?action=pkgal&sid=$sid\">Uploader Photo($noi[0])</a><br/>";

index.php

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&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&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&sid=$sid\">Upload Photo via url</a><br/>";
 
echo "<a href=\"index.php?action=main&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&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&sid=$sid\">";
  echo "Main menu</a>";
  echo "</p>";
}

index.php?action=viewuser

 echo "<a href=\"lists.php?action=viewuser&who=$who&sid=$sid\">View gallery</a><br/>";

genproc.php

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&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&sid=$sid&browse?start\">User Gallery</a><br/>";
   echo "<a href=\"index.php?action=main&sid=$sid&type=send&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&sid=$sid\">Users Gallery</a><br/>";
      echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Main</a>";
      echo "</p>";
      echo "</body>";

}

lists.php

/////////////////////////////////////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&who=$who&gid=$gid");
    addplace(getuid_sid($sid),"lists.php?action=$action&who=$who&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&who=$item[3]&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&sid=$sid&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&page=$ppage&sid=$sid&who=$who&gid=$gid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=$action&page=$npage&sid=$sid&who=$who&gid=$gid\">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=\"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&sid=$sid&who=$who&gid=$gid\">Add Comment</a><br/>";
}

echo "<a href=\"index.php?action=usergal&sid=$sid\">User Gallery</a><br/>";
    echo "<a href=\"index.php?action=main&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&who=$who&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&page=$ppage&sid=$sid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=$action&page=$npage&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&sid=$sid&type=send\">$unrd new pm</a>";
      }
echo "<br/><a href=\"index.php?action=pkgal&sid=$sid\">User Gallery</a><br/>";
echo "<a href=\"index.php?action=main&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&who=$who&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&page=$ppage&sid=$sid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=$action&page=$npage&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&sid=$sid&type=send\">$unrd New MSG</a>";
      }
echo "<br/><a href=\"index.php?action=pkgal&sid=$sid\">Users Gallery</a><br/>";
echo "<a href=\"index.php?action=main&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&who=$who");
     addplace(getuid_sid($sid),"lists.php?action=$action&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&sid=$sid&gid=$item[0]\">Use as Avatar</a> | ";
}else{
$use = "";
}
      if(candelgal($uid, $item[0]))
      {
        $delnk = "<a href=\"genproc.php?action=delgal&sid=$sid&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&action=comments2&sid=$sid&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&page=$ppage&sid=$sid&who=$who\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=$action&page=$npage&sid=$sid&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&sid=$sid\">Users Gallery</a><br/>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Main menu</a>";

    echo "</p>";
    echo "</body>";

}

who can help me to make the sql ibwf_prate and ibwf_galcom

-- 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


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

riderz Lead · 975 posts #2

ok ive made this but now the images dnt display

--
-- 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`
--

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

lee27 Developer · 63 posts #3

this is what i use on mine

-- 
-- 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`
-- 
-- 
-- 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`
-- 

using name geordielee now

spiderwebs Developer · 193 posts #4

change auto_increment to 1 it will work

riderz wrote: ok ive made this but now the images dnt display

--
-- 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

riderz Lead · 975 posts #7

who can help me with this part this part are suppose to show the image but it doesnt

 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 = "";
}

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

WhiteWarrior Principal · 1,419 posts #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

icen01 Developer · 72 posts #9

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

pin0y likes wap

Mysterio Lead · 630 posts #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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close