Jump to content

how to create categories please ? tutorial


shoutdots

Recommended Posts

its not an HTML question

 

here is the tell :

 

i need to make a directory , this directory needs categories for sure like ARTS , Computer and internet , business, this categories may need  sub categories like web development > php programming .

 

HOW TO MAKE THIS IN PHP ? i need to insert these categories in a mysql tables ... etc

 

so any one can give me a tutorial for this cos i searched phpfreaks many times and google search without finding it .

 

thanks 

Link to comment
Share on other sites

!!!

 

MadTechie THIS IS THE SECONDE TIME TO TELL YOU THIS IS NOT A HTML, AJAX QUESTION !!!!!

 

look, i will give you a code i found it on the net to know what i exactly mean !

 

  <?
include("config.php");
echo"<form action=add_child_cat1.php method=post>";
echo"sub category : <input type=text name=child_cat_name>";
echo"<br>";
// here we will put the main categories in a combo box

echo"<select name=cat_id>";
$sql = mysql_query("SELECT * FROM cat");
$num = mysql_num_rows($sql);

for($i=1;$i<=$num;$i++)
{
$row = mysql_fetch_array($sql);
$cat_id = $row[cat_id];
$cat_name = $row[name];
echo"<option value=$cat_id>$cat_name</option>";
}
echo"</select>";
echo"<br>";
echo"<input type=submit value=submit>";
echo"</form>";
?> 

 

did you know what i need now ? , i need to understand the code by a tutorial with explaining .

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.