Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Pretty sure you don't actually understand what a framework is. Also: some people actually like to learn new things. SOME people excel when given new things to learn. Some people thrive on learning. What is the point of just learning a few functions then writing the same shitty code over and over? In the past 4 months I've started using various new-to-me "things": Symfony, Behat, (obviously composer), YML, Silex, Vagrant, and Doctrine. Also had to investigate Kohana a little as we're moving off it. I've never been happier at work. I actually got to spend my work time writing a Formatter for Behat which we're going to release. My first ever open source contribution. If I just stuck with "old fashioned" php I'd be miserably making the same stupid "contact us" forms and calendar apps I was doing 5 years ago, and making a third of what I make now (in terms of money and actual software too)
  2. Moving this to the misc forum.
  3. We have a thread for this already.
  4. *shrug* did you try it? Coalesce is definitely better.
  5. Yeah we're not going to look through 6-10 pages either. Debug a little on your own.
  6. Google "CRUD" and PHP/MySQL. What you're describing is super basic. I have a tutorial on my blog, see my signature. If you need more specific help, post your code and describe your problem.
  7. IF condition do this ELSE condition do this other thing
  8. You missed it. Mist is when you have water in a fine spray. Google "normalize your data".
  9. cooper != copper. You should normalize that table.
  10. ... I think you should do some basic research on how a SESSION is stored.
  11. There's a CRUD tutorial on my blog, linked to in my signature. If you need specific help, you'll need to post code and describe your problem
  12. Dear god, is this really what they're teaching in schools? *smh*
  13. Try this: $parts = explode(".", $_FILES["file"]["name"]); $var = end($parts); Some things can't be chained like that in strict.
  14. Sure you can. How do you expect to use a table that has data just smushed together? As you are discovering, it sort of eliminates all the benefits of a relational database
  15. What does minimalistic design have to do with the features of the site?
  16. ORDER BY property DESC, value DESC Edit: If you're saying that you're storing 3 pieces of information in one column, stop it. Fix your structure.
  17. Why are you using the original code? It didn't work.
  18. You'd need to show the code where you set the session variable as well.
  19. Thanks Kicken - I personally think it looks nicer without the table at all, but I guess that's really a personal preference. My boss thinks it looks better with the table headers (This is my personal project, but we had the same issue at work)
  20. I like the fact that Twig has the shortcuts "Twig has shortcuts for common patterns, like having a default text displayed when you iterate over an empty array:" {% for user in users %} * {{ user.name }} {% else %} No user have been found. {% endfor %}How can you use this if you're generating a table?For example, I have this: <table class="table table-bordered table-striped table-hover"> <tr> <th>Name</th> <th>Description</th> <th>Actions</th> </tr> {% for service in services_table %} <tr> <td>{{ service.name }}</td> <td>{{ service.description }}</td> <td> <a class="btn btn-mini btn-primary btn-block" href="{{ path('admin_edit_service', {'id':service.id}) }}"><i class="icon-pencil icon-white" title="Edit"></i> Edit</a> <a class="btn btn-mini btn-danger btn-block" href="{{ path('admin_delete_service', {'id':service.id}) }}"><i class="icon-trash icon-white" title="Delete"></i> Delete</a> </td> </tr> {% endfor %} </table> If I wanted to use the shortcut {% else %} block to display a message, I'd have already started the table header. So what I've been doing instead is wrapping the above code in an{% if services_table|length %} ... {% else %}which is less elegant. How do you handle this? Display the table including headers if there are rows, otherwise display an else message?
  21. Your original post showed no javascript, said nothing about javascript...That isn't even a valid javascript function, so there's absolutely no way that "Worked" before.
  22. <?php $display_pages = 5; $total_pages = 10; for($i=1; $i<=10; $i++){ $current_page = $i; echo "Viewing page: {$current_page} of {$total_pages}\n"; echo '['; $start = $current_page; if($total_pages-$start < $display_pages){ $start = ($total_pages-$display_pages)+1; } for($k=$start; $k<($start+$display_pages); $k++){ if($k==$current_page){ echo " *{$k}* "; }else{ echo " {$k} "; } } echo ']'; echo "\n\n"; }
  23. You can't be that desperate, you didn't even try to change it.
  24. You should use require_once() wherever you're using include. And you don't need to wrap your function in a function. Edit: Wait, is this JAVASCRIPT? wtf
  25. Yes, I understand. I told you what your code is doing now. Change those parts to do what you want.
×
×
  • 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.