Jump to content

maxkool

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maxkool's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'd like to ask you guys to point me in the right direction. My background: I'm a beginner I have a little bit of experience with procedural PHP coding and I'm reading up on object-oriented PHP. However, I've never worked with any PHP framework, though I do have a book on CakePHP that I purchased on a whim some time ago. I've also not used, nor learned about any existing Patterns. (in fact I've only just learned the term now that I've done a search on the forum ) I'm planning to start work on a pretty large project (compared with what I've done so far). I know this is usually not recommended for beginners like myself, but the way I figure it is that, since I want to have a modular approach to the whole thing anyway, it will be just like having several smaller projects to work on in sequence. Here's what I'm trying to accomplish. The project consists of a web site where people will be able to a) search for local services (i.e. doctors in the area, taxi companies, etc.) and b) rate these services and write short descriptions / recommendations for them. I will also need to have a system for tracking user reputation, to avoid abusive conduct. (like some local business owner creating an army of clones to recommend his business) I may include a mapping system in the future but that's beyond the first Beta Now, I've never worked on anything even remotely close to this in terms of magnitude and complexity. So my question is, where do you recommend I should start? Should I use a framework or just hand-code everything and maybe use snippets wherever available? Should I use a CMS and modify it? Can this be done with procedural PHP or should I first invest some more time in learning OO? What should I be reading up on? These are some of the questions that spring to my mind as I contemplate how I will go about this project. So it would be awesome if anyone could offer pointers or advice on any of the above Thanks in advance.
  2. Nice feature, though I was a bit taken aback by the fact that the "Solved" button looks like a tab (and thus suggests it might have some effect on the content below)
  3. Whoa, so simple.. I'd written 5 times as much code and wasn't even close to getting where I wanted Thanks a lot Ben! LE. in case anyone ever needs this, here's the final thing : (pretty much GR's version, just updated $prevcat and $prevsubcat at the end) $prevcat = ''; $prevsubcat = ''; $sql = "SELECT * FROM $tbl_name ORDER BY categ, subcateg"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); while($row = mysql_fetch_assoc($result)) { $cat = $row['categ']; $subcat = $row['subcateg']; $item = $row['itemname']; $description = $row['itemdesc']; if($cat != $prevcat){ echo $cat.'<br />'; echo 'sc '. $subcat.'<br />';//if the category has changed, we also want to show the new subcat }elseif($subcat != $prevsubcat){ echo $subcat.'<br />'; } echo 'it '.$item.'<br />'; echo 'desc '.$description.'<br />'; $prevcat = $cat; $prevsubcat = $subcat; }
  4. Hi everyone, I'm a beginner in PHP and I hope the following problem is worthy of your time. I'm sure there are a million ways of handling what I'm trying to accomplish but I'm too green as yet to figure out any of them I have a MySQL table that looks something like this: Category 1 | Subcategory X | Item 1 Category 1 | Subcategory X | Item 2 Category 1 | Subcategory Y | Item 3 Category 1 | Subcategory Y | Item 4 Category 2 | Subcategory Z | Item 5 Category 2 | Subcategory Z | Item 6 Basically, a collection of Items which fall under different Subcategories, which in turn fall under 2 or 3 main Categories. I've been asked to code an interface where one can easily add Categories, Subcategories and Items. I also have to display these to the viewer in the form of a tree structure. I've had no trouble writing a form which INSERTs data into the database but I'm stumped as to how I can display this table to the viewer as a tree, e.g. show Category 1 as a title, then under that show Subcategory X and under that Items 1 and 2 etc. My idea was to SELECT everything from Category 1 and display all the Subcategories (which I managed to do) then select each Subcategory and display the items. Unfortunately this meant that Subcategory names had to be unique, because if I had the same name under different Categories, they would all be selected. Anyway, if you guys have any ideas, I'd really appreciate the help. Thanks.
×
×
  • 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.