I have tried in many ways but i'm not getting what i need š
My db tables looks like this:
p_kategori table
[CODE]
-- Table structure for table p_kategori
CREATE TABLE IF NOT EXISTS p_kategori (
id int(6) NOT NULL auto_increment,
katemri varchar(255) NOT NULL default '',
katpermalink varchar(255) NOT NULL default '',
kataktiv enum('N','Y') NOT NULL default 'Y',
PRIMARY KEY (id),
UNIQUE KEY id (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
--
-- Dumping data for table p_kategori
INSERT INTO p_kategori (id, katemri, katpermalink, kataktiv) VALUES
(1, 'Gjeneratore', 'gjeneratore/', 'Y'),
(2, 'Elektroda', 'elektroda/', 'Y'),
(3, 'Test', 'test/', ''),
(4, 'Test2', 'test2/', ''),
(5, 'Prove', 'prove/', ''),
(6, 'Prove 2', 'prove2/', ''),
(7, 'Prove 3', 'prove3/', 'Y'),
(8, 'Test 4', 'test4/', 'Y');
[/CODE]
p_produkte table
[CODE]
-- Table structure for table p_produkte
CREATE TABLE IF NOT EXISTS p_produkte (
id int(6) NOT NULL auto_increment,
katid varchar(255) NOT NULL default '',
prodemri varchar(255) NOT NULL default '',
prodimg varchar(255) NOT NULL default '',
prodinfo text NOT NULL,
prodpermalink varchar(255) NOT NULL default '',
prodaktiv enum('N','Y') NOT NULL default 'Y',
PRIMARY KEY (id),
UNIQUE KEY id (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table p_produkte
INSERT INTO p_produkte (id, katid, prodemri, prodimg, prodinfo, prodpermalink, prodaktiv) VALUES
(2, '1', 'XCV 220W', '220w.jpg', '<p>\r\n Gjenerator</p>\r\n', 'gjenerator_xcv220w/', 'Y');
[/CODE]
kategorite.php - The page where appear the category list and, if clicks on a category, will appear a new page where should be listed all products on that category.
<?php
if (!isset($_GET['id'])) // if $_GET['id'] is NOT set
{
include 'D:/Program Files/VertrigoServ/www/joni/admini/includet/variabla.php';
include (BPATH . '/includet/dbconfig.php');
$query="SELECT * FROM `p_kategori` WHERE kataktiv = 'Y' ORDER BY `p_kategori`.`ID`";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$katemri=mysql_result($result,$i,"katemri");
$katpermalink=mysql_result($result,$i,"katpermalink");
$kataktiv=mysql_result($result,$i,"kataktiv");
?>
<img src="imazhet/bulona.jpg" width="15" hspace="5" vspace="3" align="absmiddle" /><a href="kategorite.php?id=<?php echo $id; ?>"> <?php echo $katemri; ?></a><br>
<?php
$i++;
}
?>
<?php
} // end if()
else // $_GET['id'] IS set
{
if (!empty($_GET['id'])) // if $_GET['id'] is NOT empty
{
// getting infos from db
include 'D:/Program Files/VertrigoServ/www/joni/admini/includet/variabla.php';
include (BPATH . '/includet/dbconfig.php');
$query="SELECT * FROM `p_kategori` WHERE id = '$_GET[id]'";
$result=mysql_query($query);
$num=mysql_numrows($result);
$id=mysql_result($result,$i,"id");
$katemri=mysql_result($result,$i,"katemri");
$katpermalink=mysql_result($result,$i,"katpermalink");
$kataktiv=mysql_result($result,$i,"kataktiv");
// end of getting infos from db
?>
...
...
...
I don't know how to continue now!
...
...
...
<?php
} // end if()
} // end else
?>
I don't know how to continue now š ! I have tried to use the query you suggest but i't didn;t worked bcz i don;t know how and where to use it.
Can you please help me?
Thank you in advance!