I'm getting the following error, in scotspaul coding can anyone help please
Warning: Wrong parameter count for mysql_result() in /home/*****/public_html/galleryreal/cat.php on line 36
the cat.php is
header("Cache-Control: no-cache, must-revalidate");
include("../config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml><card title=\"$cat\">
";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and password='$password'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
include("../check.inc.php");
}
if ($ok>0)
{
$leigh2 = mysql_query("SELECT * FROM members WHERE username='$username'");
$owner=(mysql_result($leigh2,0,"owner"));
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 1000;
$from = (($page * $max_results) - $max_results);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM gallery"));
$total_pages = ceil($total_results / $max_results);
$sql = mysql_query("SELECT * FROM gallery WHERE cat='$cat' ORDER BY id desc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
$whoname = $row['username'];
$link = $row['link'];
$id = $row['id'];
include 'smilies.inc.php';
echo "<a href=\"$link\">$whoname</a>
" ;
if($owner=="1")
{
echo ",<a href=\"delpic.php?username=$username&password= $password&id=$id\">[x]</a>
";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&name=$name&username=$usernam e&password=$password\">(Next)</a>
";
}
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev&name=$name&username=$usernam e&password=$password\">(Prev)</a>
";
}
$i = 1; $i <= $total_pages; $i++ ;
echo "
<a title=\"Enter\" href=\"up.php?action=upload&cat=$cat&usern ame=$username&password=$password\">(Upload)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"index.php?username=$username&password=$ password\">(Back)</a>";
echo "
";
}
echo "</p>";
echo "</card>";
echo "</wml>";
?>
and table for gallery is
CREATE TABLE IF NOT EXISTS `galleryl` (
`id` mediumint(50) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`cat` varchar(50) NOT NULL default '',
`link` varchar(250) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Warning: Wrong parameter count for mysql_result() in /home/*****/public_html/galleryreal/cat.php on line 36
the cat.php is
header("Cache-Control: no-cache, must-revalidate");
include("../config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml><card title=\"$cat\">
";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and password='$password'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
include("../check.inc.php");
}
if ($ok>0)
{
$leigh2 = mysql_query("SELECT * FROM members WHERE username='$username'");
$owner=(mysql_result($leigh2,0,"owner"));
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$max_results = 1000;
$from = (($page * $max_results) - $max_results);
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM gallery"));
$total_pages = ceil($total_results / $max_results);
$sql = mysql_query("SELECT * FROM gallery WHERE cat='$cat' ORDER BY id desc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
$whoname = $row['username'];
$link = $row['link'];
$id = $row['id'];
include 'smilies.inc.php';
echo "<a href=\"$link\">$whoname</a>
" ;
if($owner=="1")
{
echo ",<a href=\"delpic.php?username=$username&password= $password&id=$id\">[x]</a>
";
}
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next&name=$name&username=$usernam e&password=$password\">(Next)</a>
";
}
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev&name=$name&username=$usernam e&password=$password\">(Prev)</a>
";
}
$i = 1; $i <= $total_pages; $i++ ;
echo "
<a title=\"Enter\" href=\"up.php?action=upload&cat=$cat&usern ame=$username&password=$password\">(Upload)</a>";
echo "
";
echo "<a title=\"Enter\" href=\"index.php?username=$username&password=$ password\">(Back)</a>";
echo "
";
}
echo "</p>";
echo "</card>";
echo "</wml>";
?>
and table for gallery is
CREATE TABLE IF NOT EXISTS `galleryl` (
`id` mediumint(50) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`cat` varchar(50) NOT NULL default '',
`link` varchar(250) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Comment