Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8800775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:40:43+00:00 2026-06-14T00:40:43+00:00

Everything works with this code but i want to have a link from product.php

  • 0

Everything works with this code but i want to have a link from product.php back to category and subcategory.

i have 3 parent categories, page1.php, page2.php and page3.php
also for those i have subcategories page1.php?subcat=1,2,3,4 page2.php?subcat=1,2,3,4

This is php code iam using to product.php

if (isset($_GET['id'])) {
$id= $_GET['id'];
$result2 = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
$count = mysql_num_rows($result2);
if ($count > 0) {
while($row = mysql_fetch_array($result2)){ 
$pid = $row["id"];
$pname = $row["name"];
$pprice = $row["price"];
$pnoncategoryid = $row["noncategoryid"];
$pdesc = $row["desc"];
}

// gjeje emrin e categorise dhe nencategorise
$result3=mysql_query("select * from noncategory WHERE ncid=$pnoncategoryid");
while($row=mysql_fetch_array($result3)){
$noncategoryname = $row["ncname"];
$categoryid = $row["categoryid"];
}

$result4=mysql_query("select * from category WHERE cid=$categoryid");
while($row=mysql_fetch_array($result4)){
$categoryname = $row["cname"];
}
//mbaro

At category and subcategory i want to have link:

<h3><?php echo $pname; ?></h3>
<div class="pbr"></div>
<h4>Category:</h4>
<p class="price"><?php echo $categoryname; ?> / <?php echo $noncategoryname; ?></p>
<div class="pbr"></div>
<h4>Description:</h4>
<p class="desc"><?php echo $pdesc; ?></p>
<div class="pbr"></div>
<h4>Price:</h4>
<p class="price"><?php echo $pprice; ?> <?php echo _valuta_ ?></p>

Sorry for my bad english, hope some1 understand me :))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:40:44+00:00Added an answer on June 14, 2026 at 12:40 am

    You want to transform text into a hyperlink. Like this?

    <?php echo "<a href='category".$categoryid.".php'>".$categoryname."</a>"; ?> / 
    <?php echo "<a href='category".$categoryid.".php?subcat=".$pnoncategoryid."'>".$noncategoryname."</a>"; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have no experience with javascript, but I found some code from this thread:
I implemented this Jquery show/hide code and everything works fine except that the box
I fallowed @Stefan Monov tutorial in this question . And everything works, but I
I have place this question before on following link with code & screenshot. TableView
I have written some code that works great, but I don't understand why it
Following this code my button works perfectly: http://twitter.github.com/bootstrap/javascript.html#modals Fades and everything. I want to
I have a link that opens a Thickbox... <a href=page.php?tag=lists-element&keepThis=true&TB_iframe=true&height=450&width=500> Everything works with this
I wrote this script to for a contact form on my website, everything works
I am using this regex to match email addresses in a string. Everything works
I am currently trying to use this gem http://github.com/pengwynn/linkedin . Everything works fine (i.e.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.