Member Avatar

Hello every one I need help help with tihs code, it works but is there an easy way to generate articles by categories and subcategories if($result = GetList("SELECT p.*,f.*,c1.* FROM ".DB_PREFIX."mediaCategory c1 LEFT JOIN ".DB_PREFIX."mediaCategory c2 ON c2.category_id=c1.category_parent LEFT JOIN ".DB_PREFIX."mediaCategory c3 ON c3.category_id=c2.category_parent LEFT JOIN ".DB_PREFIX."mediaCategory c4 ON c4.category_id=c3.category_parent LEFT JOIN ".DB_PREFIX."mediaCategory c5 ON c5.category_id=c4.category_parent LEFT JOIN ".DB_PREFIX."mediaCategory c6 ON c6.category_id=c5.category_parent LEFT JOIN ".DB_PREFIX."mediaPost p ON c1.category_id=p.post_category WHERE (c1.category_id=1 OR c1.category_parent=1 OR c2.category_parent=1 OR c3.category_parent=1 OR c4.category_parent=1 OR c5.category_parent=1 OR c6.category_parent=1) ORDER BY p.post_created LIMIT 10")){ echo "<ul class='grid'>"; foreach ($result as $row) { echo "<li class='ID-".$row['post_id']."'><span><h3>".$row['post_name'])."</h3></span></li>"; } echo …

Member Avatar
+0 forum 12
Member Avatar

here i have to store comapnyname,contactperson,city,place,maincategory,subcategory values.but i have 4 tables with data's like maincategory,subcategory,city,place. so how can i store the below data's in table.in spa table i added maincategoryid and cityid is enough or else these city and category i have to store in another table. please give some suggestion. $sql = mysql_query("INSERT INTO `spa`(`mainCatagoryid`, `City`,`ContactPerson`,`Companyname`) VALUES ('$catagory', '$city','$conatctperson','$companyname'"); place and subcategories are in array. $catagory = trim(ucwords(strtolower(mysql_real_escape_string($_POST['maincatagory'])))); $subcatagory = ucwords(strtolower(mysql_real_escape_string($_POST['relatedcategories']))); $place = trim(mysql_real_escape_string($_POST['place'])); $city = trim(ucwords(strtolower(mysql_real_escape_string($_POST['city'])))); $companyname =ucwords(strtolower(mysql_real_escape_string($_POST['companyname']))); $conatctperson =ucwords(strtolower(mysql_real_escape_string($_POST['conactperson']))); CREATE TABLE IF NOT EXISTS `catagorykeywords` ( `id` int(11) NOT NULL AUTO_INCREMENT, `MainCatagory` varchar(100) NOT NULL, `name` varchar(100) …

Member Avatar
+0 forum 2
Member Avatar

Some weeks ago I posted this and I realized from the referrals that it may help to be as a code snippet. This is an example of getting products details from categories – subcategories using ajax call. I am fond of OOP and this is not , but I believe that will help others understand of how this things can happen. Demand: There are some sound systems of cars (products) each of them has an article link and some other details (e.g. Voltage) ,those products can be categorized , so we have categories of them. The categories can have either …

Member Avatar
+1 forum 3

The End.