Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
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)
-
Moving this to the misc forum.
-
We have a thread for this already.
-
*shrug* did you try it? Coalesce is definitely better.
-
Yeah we're not going to look through 6-10 pages either. Debug a little on your own.
-
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.
-
IF condition do this ELSE condition do this other thing
-
You missed it. Mist is when you have water in a fine spray. Google "normalize your data".
-
cooper != copper. You should normalize that table.
-
Variables initialize everytime I go to a page
Jessica replied to ady_bavarezu89's topic in PHP Coding Help
... I think you should do some basic research on how a SESSION is stored. -
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
-
Dear god, is this really what they're teaching in schools? *smh*
- 3 replies
-
- javascript
- help
-
(and 3 more)
Tagged with:
-
Try this: $parts = explode(".", $_FILES["file"]["name"]); $var = end($parts); Some things can't be chained like that in strict.
-
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
-
What does minimalistic design have to do with the features of the site?
-
Why are you using the original code? It didn't work.
-
You'd need to show the code where you set the session variable as well.
-
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)
-
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?
-
Variables initialize everytime I go to a page
Jessica replied to ady_bavarezu89's topic in PHP Coding Help
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. -
<?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"; }
-
You can't be that desperate, you didn't even try to change it.
-
Variables initialize everytime I go to a page
Jessica replied to ady_bavarezu89's topic in PHP Coding Help
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 -
Yes, I understand. I told you what your code is doing now. Change those parts to do what you want.