Jump to content

guinbRo

Members
  • Posts

    30
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Utah, United States

guinbRo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey guys, I'm entering the amateurish level of programming right now, but have a challenging project ahead of me. Here is a brief scope of the problem: We are collecting a lot of data. It ends up being essentially 53 columns in the CSV. The first thing I noticed was that there were certain portions of the data that were very likely to repeat. This led to the following Schema (MySQL) to decrease redundancies: TABLE Markets (Relies on nothing) (Holds data about markets) TABLE Contacts (Relies on markets) (Contacts are associated with a market) TABLE Events (The events belong to both a market and a contact) TABLE Event Products (This only relies on an Event) Essentially my task is to automate the process since we'll be processing thousands of rows. So the script would probably need to behave like so: Import in markets Then import associated contacts (as well as the unique market id assigned by MySQL) Then import associated events (placing the unique market and contact id assigned by MySQL as well) Then import associated event products (placing the unique event id assigned by MySQL as well) As you can see this is probably really challenging. I've looked around a bit for some decent tutorials or reading. Sorry for the long winded post, here are my three questions: I cannot accurately estimate how long a project like this should take me, in your experience how long does a project like this take? Am I going about this the right way? (Even using PHPMyAdmin to import took a long time due to having to get the appropriate ids) Do you know of any good resources, or books for this? Thanks a million!
  2. Thank you. I used the group_concat and group_by to achieve the results I some what wanted, but your method is giving me more control and is leaving less of a code footprint in my view file. Thanks again .
  3. So this topic could go to code igniter, mysql queries, or here. If this is in the wrong spot I apologize in advance. Anyways, my issue is generic. I want to get better with using proper MySQL queries and I'm trying to display a list of school classes that have assignments associated with each one. (Think like categories with blog posts associated to the categories). What I want to do is display a Class, and underneath have a list of assignments. However with the code I'm currently using it's printing the school class name for each assignment there is, not what I want or need. I could do this pretty easily by simply executing two queries (one to get the class, and the one to get the assignments associated with said class), but I feel that there is an easier--and more correct way. Here's the code i'm working with: blog_view.php <body style="margin-top: 100px;"> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="brand" href="#">McDonald Sandbox</a> </div> </div> </div> <div class="container-fluid"> <div class="span2"> <ul class="nav nav-pills"> <li><a href="#"><i class="icon-plus-sign"></i> Add Class</a></li> <li><a href="#"><i class="icon-plus-sign"></i> Add Assignment</a></li> <li><a href="#"><i class="icon-wrench"></i> Settings</a></li> </ul> </div> <div class="span10"> <?php foreach($categories as $item): ?> <h2><?php echo $item['cat_title']; ?></h2> <div class="well"> <h4><?php echo $item['assign_name']; ?></h4> <?php echo $item['assign_desc']; ?> </div> <?php endforeach; ?> </div> </div> </body> </html> blog_model.php <?php class Blog_model extends CI_Model { function __construct() { $this->load->database(); } function get_latest() { //Select our classes, and get assignments from each class $this->db->select('*'); $this->db->from('categories'); $this->db->join('assignments', 'categories.cat_id = assignments.assign_cat_id'); //Return the classes and assignments in an array $query = $this->db->get(); return $query->result_array(); } } ?> blog.php (controller) <?php class Blog extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('blog_model'); } public function index() { $data['categories'] = $this->blog_model->get_latest(); $this->load->view('header'); $this->load->view('blog-view', $data); } } ?> Also please feel free to criticize coding habits that you feel I could do better in (not a whole lot of actual code there, but if anything stands out). Thanks for your help .
  4. I don't think the site theme matches your goals.
  5. You're calling $this outside of the class is most typical reason for this error.
  6. I could be misunderstanding your problem, but it sounds like sessions would solve your problem. For example, when the user claims the diamonds create a session that signifies that they've gotten their diamonds. Here's an example: <?php session_start(); if(isset($_SESSION['gotDiamonds'])) { echo'You've already gotten diamonds!'; } else { //proceed with giving them diamonds $_SESSION['gotDiamonds'] = true; } ?>
  7. I'm not sure if this necessarily makes it a true anagram. Still, sort the words a-z and what you could do is use preg_match with the word to see if it is included in the input.
  8. Anyone going to try and go? Student price for me, wo0t
  9. If all you're trying to do is figure out if two words are anagrams of each other, sorting the words a-z will work really well. If you're trying to print a valid anagram, then as has been suggested provide a word list. I'd maybe create an array then like this: array( "abt" = > array( "bat", "tab" ), "enst" = > array( "sent", "tens", "nets" ) ); That way the key is a sorted version of all the possible words you want.
  10. I can't tell if this is fake, but I went down the road you did in high school and after some learning I started selling my "skills". My biggest suggestion: back off trying to make money right now and continue to practice. Read into theory heavily. Work on an open source project, or find neighbors and relatives who need work done and complete jobs for them. I wouldn't post your age either, but that's just me. Lastly, and not to be too critical, I wouldn't want to hire you. You have a site where there are no working links despite the indication that there is, no real information on yourself, and poor grammar.
  11. For what it's worth I really dig the design. It works perfect in chrome for me. This is a bit OCD to point out, but I feel like the six boxes you've got at the bottom of the landing page should be the same size. One is smaller than the rest due to less text.
  12. I think it will not solve the issue.Check out http://proxy4free.com it provides list of proxy sites based on different countries. Then how can we trace the area ? But I think this answers your own question. It is difficult to ban someone because there is no way to uniquely identify them on the web all the time. So this means that banned users should have as many loops to jump through. Ban their IP, ban their email, validate a phone (if possible, text is easiest), make the registration process as long as possible, log IPs in a certain region if it contains a user banned in the past week. You want to keep banned users away, and honestly it's a gimmick. How badly do you want the banned user to be kept off? The more you try to do to keep the banned process automated, the higher amounts of hoops everyone has to jump through. I worked customer support for eBay for a couple years until just last month. A banned user could usually get back onto the site with little work. EBay would flag the account and someone would usually take a look at it. Truth is bans require a staff or a person (depending on the scale of operation) to enforce. At least in my eyes.
  13. http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ Not to be that guy, but google.com might be a friend on this one
  14. What you're wanting to do is extremely complicated. Now I'm sure someone can get you off on the right foot, but I want to help set down some of the ways I see this being possible. First we have the challenge that the user can create a new email. This is true, if possible you could try to do account verification by phone (text) since a new phone number requires a level of dedication that most people who are banned will not go to. The second option, and much more practical, would be one that logs the IP. Now since an IP is changing you could pull a IP trace, and if the IP is near a certain area that has been banned then consider flagging the account for someone to review it. Third, and this isn't so much an option as it is an idea would be to simply display a server error. Don't let the user know they've been banned when they visit the site. This stops the user from trying to break the ban so to speak. Otherwise it's dang near impossible from keeping people off your site in my eyes. Perhaps someone else has a solution to this, but this would be the way I see it.
  15. Well yeah, your function can't work without the specified parameters. It looks like it wants, for example, a location where the image is at, the location where the new image will be placed, etc. Without passing these parameters the function won't work. So what I mean is that when you call the function, you have to be passing it the information it desires.
×
×
  • 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.