Jump to content
Killersites Community

HTMarcosL

New Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About HTMarcosL

  • Rank
    New member
  1. Hey guys and gals, before I ask, I do want to point out that PHP and JS seems very AWESOME to me and I really want to learn it. LIKE REALLY BAD. I am willing to do whatever I can to learn what I need to learn! So I just finished the 3rd project. Which is PHP Tag Cloud. And I am still having some trouble understanding what's going on within the code. For example, I am understanding the concepts of a 'loop' or 'if' and 'else', and 'while.' I get what they are doing. But, when it comes to the code itself(syntax), I am still pretty lost. In this example below, I am totally lost as far as the syntax, but I understand what we are trying to achieve. (this is a snippet of code from the downloaded zip file, not from my version of code) function get_tags() { $this->tags = array(); $this->largest = 0; // get tag id, tag name and the number of times the tag has been used $result = $this->mysqli->query("SELECT posts_to_tags.tag_id, tags.name, COUNT(posts_to_tags.tag_id) AS total FROM tags, posts_to_tags WHERE posts_to_tags.tag_id = tags.id GROUP BY posts_to_tags.tag_id"); if ($result->num_rows > 0) { while ($row = $result->fetch_object()) { // figure out which tag has been used the most often. However many times that tag was // used will be placed within $this->largest for later use if ($row->total > $this->largest) { $this->largest = $row->total; } // add tag to array $this->tags[] = array('id' => $row->tag_id, 'name' => $row->name, 'total' => $row->total); } // sort tags usort($this->tags, array('tagcloud_model', 'compare_names')); } else { // if there are no results to display $this->tags = FALSE; } } // used by the usort function within get_tags() above function compare_names($a, $b) { return strcmp($a['name'], $b['name']); } I should mention I have only been learning PHP for few days all together, only from Stef's course and these projects. Any tips, advice, or ideas on how to grasp it better?(obviously I am going to continue my learning process, videos, tutorials.) I just want to see if maybe I can understand these projects a bit better as I am learning them. Do you think I should continue the projects and trust the process as I go, or take a detour and try and understand some things more before I finish the projects? THANK YOU FOR ANY RESPONSES.
  2. It's chapter 2 lesson 2 of PHP and MYSQL where we are learning to enter a data table. Towards the end there is something about turning the password on or off and I thought I turned it off but I am not sure what happened, but I got locked out of the phpMyAdmin. I deleted mamp and am going to reinstall it later today. Not sure if there was an easier way of doing that? I tried searching the internet and most fixes were for wamp files so I couldn't figure out in the mamp configuration files. Hopefully just downloading it again will fix it?
  3. Please help, the video I was watching is from the studioweb courses and obviously its a little outdated(sorry). So when the password section came up it was set to 'on' and I thought I turned it 'off'. The video demonstration is saying to leave the password to 'off', but on my computer local server it was actually set 'on' so I turned it 'off' and now I am locked out of the phpMyAdmin. I have been looking for tons of code and help online and I am striking out.. Please help!
×