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 

!!!

 

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 .

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.