This is a discussion on "mySQL - PHP (problem) - XML - Flash" within the PHP Forum section. This forum, and the thread "mySQL - PHP (problem) - XML - Flash are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
mySQL - PHP (problem) - XML - Flash
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Hello good people
Basically I need to spit out an xml page to create a flash menu. I'm almost there but for my if else statements, I think. It's coming out all pear shaped. The structure of the existing mySQL table is id_category, category, name, description. Category is "0" when top level. When it is a sub category "category" is the same number as id_category of the parent record. The parent record can be a subcategory. I am going a max of 3 levels. I have inc_sql.php:
Quote:
Quote:
The sql statement spits out the following with some joins and aliases: name subitem subsubitem Accessories Sportswear Sun Creams New Category Null Null Null would be where there is no sub or subsub category. There could be a subcategory and no subsubcategory. Best regards Kevin |
|
|
|
|||
|
Re: mySQL - PHP (problem) - XML - Flash
OK never mind I managed to get it.
After about a million lines and fiddles I discovered it would have never worked with that query. Anyway I started from scratch and have it sorted - yeah! Sometime you can't see the wood for the trees. It takes a huge hiccup to realise you need to take a step back and re-evaluate the situation. ciao! PS Have a fantastic day (& the weekend too). |
|
|||
|
Re: mySQL - PHP (problem) - XML - Flash
I can do indeed, though I think it's rather specific. I cleaned it up and added some comments.
It uses the following mySQL information: Table: categories Fields: id_category, category, name The table exists from a separate application, I wanted to create a menu with xml from the categories information. Note: the category field, in this case, must equal the id_category to become a child(sub) item of that category. You could always change the outputs to reflect an a href link, and indent the output of the sub and subsub categories with a hyphen or style with css. categories.php:
|
![]() |
| Tags |
| flash, mysql, php, xml |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL and Flash | ragnar21583 | Flash & Multimedia Forum | 2 | Apr 29th, 2007 09:12 |
| MySQL to PHP to Flash | ManData | Flash & Multimedia Forum | 1 | Oct 30th, 2006 17:25 |
| PHP-MySQL problem | robertboyle | PHP Forum | 4 | Jun 16th, 2006 13:02 |
| Mysql syntax problem... | ktsirig | Databases | 1 | Jan 6th, 2006 15:51 |
| Mysql sorting problem.... | mills | Databases | 2 | Jul 26th, 2005 09:08 |