Parent Child menu in product catalogue - PHP MySQL
Hi, I am trying to build a product catalogue, can anyone tell me how to create parent child menu system, ie; Phone>Nokia, Ericsson, etc is there a tutorial how to do this?
Thanks
Bert
Hi, I am trying to build a product catalogue, can anyone tell me how to create parent child menu system, ie; Phone>Nokia, Ericsson, etc is there a tutorial how to do this?
Thanks
Bert
Similar Messages
-
Parent-child hierarchy of production orders
Hello
Production orders make parent child unbalanced hierarchy of up to 15 levels (see below)
prod order1
-prod order11
prod order111
prod order112
-prod order12
prod order121
How would u recommend me to store this hierarchy so that I will be able to quickly collect variances (one per order) from selected node till the lowest level?
thanksprod order1
--prod order11
prod order111
prod order112
--prod order12
prod order121
compoments A B are required to produce material D (prod order1)
components A1 A2 are required to produce material A (prod order11)
components A11 A12 are required to produce material A1 (prod order111) -
[php+mysql] best way to integrate a tree category menu base on db?
Hi all,
I have a products catalog where all products are organized in
categories.
The category structure is something similar to this:
category 1
subcategory 1.1
sub-subcategory 1.1.1
sub-subcategory 1.1.2
sub-subcategory 1.1.3
sub-subcategory 1.1.4
sub-subcategory 1.1.5
subcategory 1.2
subcategory 1.3
category 2
subcategory 2.1
subcategory 2.2
sub-subcategory 2.2.1
sub-subcategory 2.2.2
sub-subcategory 2.2.3
sub-subcategory 2.2.4
subcategory 2.3
...and so on...
In general, I have 3 category levels.
I manage these catagories with only one table using self
foreign keys.
Now I need to add a tree menu that will reflect the above
category
structure.
I use php + mysql to store the tables (products and
categories.
I found several javascript samples that allow you to do
something similar
but with static data.
I'm searching for a tree menu that is easily customizable and
that can use
dynamic data from mysql db.
Is there a tutorial or smple that would do the trick?
TIA very much!
tony ;).The page I'm trying to create is here www.hollisterairshow.com/plan-results.php and the questionnaire is here www.hollisterairshow.com/helpusplan.php .
I went ahead and created recordsets using advanced recordsets and these seem to be working, here's a sample SQL
SELECT *
FROM plan
WHERE Saturday = 'Saturday' AND plan.howArriving = 'Auto'
I created a recordset for each combination of day and transportation mode - six in all
This selected the correct records.
To display the count of how many records selected I then used in DW Insert/Data Objects/ Display Record Count/Total Records which generated the following code:
<?php echo $totalRows_rsSatAuto ?>
This worked OK - not elegant but OK and I repeated it for each combination of Day and Transportation mode!!
So there are two problems I'm having:
I know I can select the records I want but how do I display the sum of the column containing "How many in your party" - i.e. in the PHP code generated above what do I replace $totalRows_rsSatAuto with?
There are two questions using radio buttons where I'd like to display the count and % for each option selected. I can select all records for these questions but what code do I put to sum the number of selections for each option and what code do I put to calculate the percentage
I understand the arithmetic involved which is pretty simple but it's the mechanics of coding that has me stumped. It would really help if you could give me a sample for say the "Are you camping overnight" question which has a "Yes/No" option only. In my mundane way I would create two recordsets, one for "Yes" and one for "No", and use the same technique I describe above for counting Total Records in each recordset, but then I'm stuck with how do I calculate and display the percentages. I must be missing something very obvious as I'm sure there just has to be a more elegant solution.
Thanks so much for your continued interest.
Tony -
PHP/MySQL Test/Production Server best practices
Hello,
I am currently learning PHP/MySql and have setup a test server to develop on and a production server to go live with. I wanted to know what are the best practices for synchronizing the test server with the production. Should I export the database from the test server and import it to the production server each time I make a change or is there better way to incrementally sync the databases. I am using Dreamweaver to design the web site.
Thanks,
NickThanks, but does this mean that after I go live I should make changes on the production database only and not use the development database, if say I need to add a new table or record(s)?
Procedure
1. Take production web site down
2. Export/Save current database
3. Make changes to production database
4. Export/Save new database
5. Bring production web site up
Is this correct? -
I use Dreamweaver CS3 to create my sites on a Windows/Apache
Server with PHP5 and Mysql 5. The site works perfectly on my
testing server at home. On the Web server I'm getting the following
error which causes the page to not load:
PHP Warning: mysql_query(): supplied argument is not a valid
MySQL-Link resource in
/hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
on line 63
PHP Warning: mysql_select_db(): supplied argument is not a
valid MySQL-Link resource in
/hermes/bosweb/web248/b2488/ipw.horsehelp/public_html/residents/residents.php
on line 61
The lines in question are:
Line 61 - mysql_select_db($database_conn_phh, $conn_phh);
$query_getSuccess = "SELECT * FROM horses WHERE status =
'Success Story' ORDER BY horse_barn ASC";
$getSuccess = mysql_query($query_getSuccess, $conn_phh) or
die(mysql_error());
$row_getSuccess = mysql_fetch_assoc($getSuccess);
$totalRows_getSuccess = mysql_num_rows($getSuccess);
All of the code is supplied by Dreamweaver. I did not tweak
the code. I'm not a web developer and what I have found out there
is still reading greek to me. My connection file is working and
connecting the database that I have tested.
Since the above code is throughout the site in one form or
another it's causing me major headaches. Any help would be
appreciated.This is the first time I've used Adobe products so if the
following is in the wrong forum (It's the closest one I found so
far) or the format is incorrect please forgive me.
I'm new to Dreamweaver CS3 and as I was reading the "first
steps" it mentions to set up a Dreamweaver site right away. I got
as far as completing "Site Definition" page under the basic side of
the setup screen.
The next screen is "Do you want to work with server
Technology?"
There are 2 options - Yes or No. If you select yes a
drop-down menu appears with several options (but you can only
select one)...
Asp Javascript
Asp VbScript
Asp.net#
Asp.net Vb
Cold Fusion
JSP
Php MySql.
I know nothing about these format and brand new to web design
so I thought it best to contact GoDaddy (my hosting account) to
find out what their servers would support. I spoke to a tech rep
but she wasn't sure.
She did mention that I have a windows hosting account and Php
MySql would not work unless I changed to their Linux platform at no
additional charge.
The site I have in mind will design with CSS, Liquid layout,
have some flash, widgets, an inquiry form that clients complete and
results e-mailed to me, auto-responder, Paypal link and whatever
else I can discover from Dreamweaver.
My question being:
I haven't even begun designing my site because I do not know
what weather I should select the Yes option and select one of the
formats mentioned above (if so which one) - or select the No
option. If I do select the No option at the very beginning, will I
have problems with my site uploading and working correctly?
Thank you
Travis -
Show if field is not empty - PHP/MySQL
Is there a way I can only show bits of a page if a recordset
has entries in a certain field, automatically hiding the area if
the field is empty. (PHP/MySQL)
To put it in real terms, I have loads of products listed in a
repeating table. If a product has a photo gallery related to it
there is a 1 entered in 'photos' field, it has a video attached
here is a 1 entered in 'videos field and likewise for reviews it
will have a 1 entered in the reviews field.
What I'd like to have is a photo, video and review icon/link
in the 'master table' which only appears in the repeated products
that have a 1 listed in that field and have them not appear at all
when there is a 0 in the field.
Can anyone help me figure it outADDT is certainly a great help, as it - among many other
features - will allow you define whatever page element as
"show/hide" based on a query result -- for this it´s using a
so-called "condition builder" which lets you do that without
coding.
However you can achieve the same result without needing to
resort to ADDT -- by using a basic "if" condition that´s
checking the respective table column for having the value "1"
stored, and if so, display the page segment
The following 3 examples should work when replacing the
sample "queryname" with the query name your page is actually using:
<?php if ($row_queryname['photos'] == '1') {?>
display photo icon here
<?php }?>
<?php if ($row_queryname['videos'] == '1') {?>
display video icon here
<?php }?>
<?php if ($row_queryname['reviews'] == '1') {?>
display videos icon here
<?php }?> -
Parent child relation using query
Hi,
If i pass one parameter as a parent.It will
retrieve all the child and subchild...
but it will be retrieved by one single query.
Is it possible?If possible pls give me an idea.
I got the inner most child using stored procedure and recursive fn.
But I couldnt get the child and subchild using
single query....
pls give an idea
below i gave table for example
Sno Parent Child
1 MD GM
2 GM Material manager
3 GM Production manager
4 Production manager Material staff
5 Material staff production staff
6 production staff Material student
7 Material student production student
if i pass GM as a parent. it will retrieve
material manager and production manager...but it will be worked in single query
ThanksHi,
SELECT * FROM t11
START WITH parent='GM'
CONNECT BY PRIOR child=parent
Out put :-
2 GM Material manager
3 GM Production manager
4 Production manager Material staff
5 Material staff production staff
6 production staff Material student
7 Material student production student
Pavan Kumar N -
Load Parent-Child dimension with attributes by rule file
Well, I've cracked my head open while banging against this wall.
Task is plain & simple:
How can I load build dimension from such table, using rule file?
Data
ProductParent ProductChild ProductAttribute
Balls Ball_8 Round
I want to load both product dimension and attribute by single rule file (neither of these dimensions exists in database before load), so I do the following:
1) Set dimension build settings, creating dimension Products (marking it P\C generated, sparse), having an attribute dimension AttributeDim
2) Mark the fields as Parent, Child and AttributeDim of dimension Products
After loading rule file a get three types of errors:
a) "Base member (Balls) association level does not match base dimension association level" -- does this mean that I cannot assign attributes in P\C way?
b) "Record #327 - Can not uniquely identify member by Balls (3335)
Balls Ball_8 Round" -- That's strange, I thought member should be identified by Ball_8 (and this column is unique)
c) "\\Record #418 - Error in association transaction [Ball_8] to [Round] (3362)"
I've read all I could find on topic from this forum, network45 board and going to start my way through metalink3, but maybe some kind soul will rescue me from drowning in information ocean?Hi,
Outline is blank at the start of load and I expect dimensions Product and ProdAttribute to be added.
Generations are unapplicable, since I can't turn this parent-child dimension (it's ragged) into generation one.
And, by the way Integration Services manages to do this somehow, why rule files wouldn't? -
Parent Child [MSAS cube is not working in BO]
Hi
Does anyone know if the BO is prepared to work with the Parent Child concept? I'm asking that because I've created a universe connected into a MSAS cube and it's not working for hierarchies designed using the parent child concept. When I include the field in the report, it return me a null value, in other words, an error, however if I remove this field the report works fine.
does anyone suffer of the same issue?
ThxHi Rody,
this forum is for the SAP BusinessObjects BI Solution Architecture. I would suggest you post the question into the SAP BusinessObjects product forum for the product that you are trying to use.
regards
Ingo Hilgefort -
Except function with parent child hierarchy using mdx query
HI,
I need to remove some items using mdx query in parent child hierarchy.
I tried with below query,it is not removeing ,could you please help me.
SELECT
{[Measures].[Amount]} ON
COLUMNS
NonEmpty([Account].[Accounts].[Account Level 01],[Measures].[Amount])
ON ROWS
FROM (SELECT
-Descendants({[Account].[Accounts].&[47]},,Leaves)
} ON COLUMNS
FROM [Adventure Works])
induHi Indu,
Why do you remove some itmes using
Descendants function? Generally, we use FILTER function to achieve the requirement.
WITH SET [CustomAccounts] AS
FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name<>'Net Income')
SELECT {[Measures].[Internet Sales Amount]} ON 0
[CustomAccounts] ON 1
FROM [Adventure Works]
WITH SET [CustomAccounts] AS
FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name='Net Income')
SET [RemainingAccount] AS
[Account].[Accounts].[Account Level 01]- [CustomAccounts]
SELECT {[Measures].[Reseller Sales Amount]} ON 0
[RemainingAccount] ON 1
FROM [Adventure Works]
Results.
References.
http://www.databasejournal.com/features/mssql/article.php/3306101/MDX-Essentials-Basic-Set-Functions-The-Filter-Function.htm
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c0149678-97f2-4066-903f-7f9e9ff09b56/filtering-out-dimension-members-with-mdx?forum=sqlanalysisservices
Regards,
Charlie Liao
If you have any feedback on our support,
please click here.
Charlie Liao
TechNet Community Support -
SQL for Parent-Child Hierarchy
Please suggest which would be best way to achieve the below logic.
SQL to pick up parent child relationship within same table with a certain logic.
Example:
mod_product_number Product_Hierarchy
H555888 PH05678
H888987 H555888
H8889 H555888
H9955 H555888
H999999 H555888
P6666 H999999
P5555 H999999
Example: I expect the rows with H8889,H9955 & P6666 & P5555 to be sub-category values value for product hierarchy H555888.
If there are rows with H8888987 as Product_hierarchy, we will pull up those rows too for product hierarchy H555888.
The extra condition is we drill down only on 7 character mod_prod_number not on 5 character mod_prod_number. We pull out all sub category mod_prod_number for all distinct Product hierarchy.You can use Hierarchical Queries
See.. http://docs.oracle.com/cd/E11882_01/server.112/e10592/queries003.htm
select lpad(' ',2*(level-1)) || to_char(trim(t.mod_product_number)) prod,
SYS_CONNECT_BY_PATH(t.product_hierarchy, '/') "Path",
LEVEL
from temp_table t
start with trim(t.product_hierarchy) = 'PH05678'
connect by prior trim(t.mod_product_number) = trim(t.product_hierarchy);
. PROD Path LEVEL
1 H555888 /PH05678 1
2 H8889 /PH05678 /H555888 2
3 H888987 /PH05678 /H555888 2
4 H9955 /PH05678 /H555888 2
5 H999999 /PH05678 /H555888 2
6 P5555 /PH05678 /H555888 /H999999 3
7 P6666 /PH05678 /H555888 /H999999 3 -
Parent-Child Billing and Invoice Presentment
Hello gurus,
Have a question around parent-child billing where the business scenario is that a global HQ represents the single bill-to for multiple ship-to locations across the world. The idea is that the Global HQ receives a single invoice for multiple children and ideally a summary page detail as well as the specific invoice for that child.
In terms of splitting the billing documents I suppose there are 2 routes:
1) Standard splitting of billing documents (controlled via Copy Control) so that each distinct Ship-To generates its own billing document. Then the billing documents would need to be grouped together somehow for sending to the single Bill-To - not sure how that grouping could occur after the Billing Documents are generated?
2) Break the splitting of billing documents by Ship-To so that a single billing document is created for all ship-to's for a single bill-to.
Any help on this or whether one of these is the correct approach? The issue is complicated further by the fact that we would like to product a summary page for the global bill-to stating the summary values of all sold-to by country. We have considered using a heavily customised print program tool to add up the ship-to figures for display on an invoice but not sure if SAP can create this 'grouped summary calculation' itself?
Apologies for the long windedness - any help much appreciated!In copy Control maintain Requirement as 003 and check if the desired outcome is achieved.
regards,
Rajesh Banka -
Security on Employee Parent Child Dimension with SCD 2
Hi
I am looking for a solution for how to get all child members of a Parent employee including the one in the history. I tried multiple ways the problem which I am facing are
Scenario 1: When I am using this approach, since the Employee with 'Jump' as employee id do have a history record with no children under him I am getting 'Null'. But there are new records (last 3 SCD changes) where he has employees under him.
SELECT descendants(
// Check if current employee is a manager
iif(hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))),post).item(0).item(0).parent.datamember is
hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))), post).item(0).item(0),
// End of check if current employee is manager
hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))),post).item(0).item(0).parent,
hierarchize(exists([Employee].[Manager Employee Dim ID].members,
(strtomember("[Employee].[Employee Login ID].&[SIC\jump]"))), post).item(0).item(0))) ON 0,
[Measures].[Aggregate Count] On 1
FROM [Data Ware House]
Scenario 2: When I put a filter (as a set) to check if the record is current then I am getting the latest record for employee 'Jump'. But here the problem is that the employee under him I am only getting the [Measures].[Aggregate Count] of the latest
change only.
SELECT descendants(
// Check if current employee is a manager
iif(hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])),
post).item(0).item(0).parent.datamember is
hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])), post).item(0).item(0),
// End of check if current employee is manager
hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])),
post).item(0).item(0).parent,
hierarchize(exists([UW Employee].[Manager Employee Dim ID].members,
(strtomember("[UW Employee].[Employee Login ID].&[SIC\flew]"),[UW Employee].[Current Flag].&[Y])), post).item(0).item(0))
) ON 0,
[Measures].[Contract Change Aggregate Count] ON 1
FROM [Data Ware House]
If any one can help me out with this that will be helpful.
What I need is all the members under the employee 'Jump', including the Old scd records for 'jump'
regards
Robin
RobsHi,
Outline is blank at the start of load and I expect dimensions Product and ProdAttribute to be added.
Generations are unapplicable, since I can't turn this parent-child dimension (it's ragged) into generation one.
And, by the way Integration Services manages to do this somehow, why rule files wouldn't? -
Parent Child Data - Populate within a Dropdown
Hi All ...
I have a mysql database with the following fields
ID (Int) - Title (VarChar) - ParentID (Int)
This table is used to display categories with it's parent. Categories with the ParentID of 0 means that it is a root category.
What'm trying to do is query the database and populate all values (with it's parent & child(s)) within a regular html dropdown box.
So the output of the dropdown whould look like:
Home
Home > Sub Cat 1
Home > Sub Cat 1 > Sub Sub Cat 1
Home > Sub Cat 1 > Sub Sub Cat 2
Home > Sub Cat 1 > Sub Sub Cat 3
Home > Sub Cat 2 > Sub Sub Cat 1
Home > Sub Cat 2 > Sub Sub Cat 2
Home > Sub Cat 3
Home > Sub Cat 4
Home > Sub Cat 4 > Sub Sub Cat 1
Home > Sub Cat 5
Any ideas on how I can accomplish this?
Many Thanks
ShafiqAs far as I know you cannot elegantly handle this sort of datastructure in MySQL (this is based on 5min of googling). If you had Oracle you could use CONNECT BY PRIOR, and with SQL Server one can use Common Table Expressions to effect much the same thing (except in a pretty clunky fashion, IMO).
As far as I can tell, MySQL has neither of those options. You'll need to do some sort of horrific recursive proc, or something like that. Although I saw references to MySQL not even being able to do that (I didn't check how contemporary those comments were).
If you can possibly ditch that way of modelling your data - it really doesn't scale so well - have a look at nested set hierarchies:
http://en.wikipedia.org/wiki/Nested_set_model
The only modification I make to that is to store the parent with each node too, which makes sibling operations much easier. Nested sets work really well with hierarchical look-ups though.
Adam -
SubSelect Not filter data for Parent/Child hierarchy
I have data for my parent /child dimension like that
DimCust
Fact Sal
Customer ID
Parent ID
Customer Type
Product Id
Customer ID
Year
Sales
1
1
Retailer
4
1
2015
100
2
1
Retailer
4
2
2014
200
3
3
Retailer
4
3
2014
300
4
3
Retailer
4
4
2015
400
5
5
Retailer
4
5
2015
500
In my query,
I use sub select to filter
data for year 2014c and product id 4, when I got result
it’s missed the aggregation of customer id 1 and 4.
Even I try to pass in where clause it’s also not give correct result.
code,
with
set ba EXISTS([DIMCustomer].[Level 02].allmembers, [DIMCustomer].[Hierarchy].&[MyHierarchy],"factTable")
SELECT
[Measures].[Sales]
} ON 0,
[ba]on 1
FROM (SELECT ( { [CropYear].[CropYear].&[2014] } ) ON COLUMNS
FROM (SELECT ( { [DimProduct].[ProductID].[4] } ) ON COLUMNS
FROM [myCube]))
please help me on this, what is the best practices.
Regards,
ManishHi manishcal16PPS,
According to your description, you want to slice the fact data on Year 2014 and Product 4. Now you find the result missing the customer 1 and 4. Right?
In this scenario, based on your Fact Sal table, both customer 1 and 4 are on Year 2015. So when you filter the data, it will not show customer 1 and 4. It returns correct result. For filtering data, either using sub select or specifying slicer axis
can achieve your requirement.
Reference:
Specifying the Contents of a Slicer Axis (MDX)
Best Regards,
Simon Hou
TechNet Community Support
Maybe you are looking for
-
How to populate the condition tables of CRM 7.0
Hello Friends, How to populate values in CND* tables , i assume these are the tables that hold the conditions. Thanks and Regards, Vasu
-
Pricing not getting in Slaes order
Hi, When I try to crate sale order I am not getting Standard Price amount in Sales order. Note: All the Price related settings are set correctly.
-
Trouble transfering Family Guy Digital Version onto iTunes and iPhone
I got the family Guy Blue Harvest today and I put the 2nd DVD in my PC drive and then click on transfer then it asked me for the code so i typed in the code and confimed the code 3 times, then iTune started to transfer the files, then when it was alm
-
Acrobat 8 Pro, IE 7, PDFmaker missing
I do not know what happened but all of a sudden the PDF toolbar is missing. When I right-click, the context menu items are missing. I've repaired my Adobe installation and re-booted. Any ideas? I've searched the internet high and low and haven't foun
-
OVM3.2.2 Unexpected CPU Pinning for Win2008EntR2
Hi all, I installed OVM 3.2.2 on HP Gen 8 server with 16 cores for testing. Then : 1. Windows 2008 r2 Enterprise edition is installed. 2. No CPU pinning was set 3. When I tried to check the CPU allocation with the "xm vcpu-list" command, the informat