Jessica
-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Posts posted by Jessica
-
-
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.
-
... 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*
-
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?There are still some people who prefer minimalistic designs
-
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.
-
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?
-
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.
-
Viewing page: 1 of 10
[ *1* 2 3 4 5 ]
Viewing page: 2 of 10
[ *2* 3 4 5 6 ]
Viewing page: 3 of 10
[ *3* 4 5 6 7 ]
Viewing page: 4 of 10
[ *4* 5 6 7 8 ]
Viewing page: 5 of 10
[ *5* 6 7 8 9 ]
Viewing page: 6 of 10
[ *6* 7 8 9 10 ]
Viewing page: 7 of 10
[ 6 *7* 8 9 10 ]
Viewing page: 8 of 10
[ 6 7 *8* 9 10 ]
Viewing page: 9 of 10
[ 6 7 8 *9* 10 ]
Viewing page: 10 of 10
[ 6 7 8 9 *10* ]
<?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.
-
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.
Laravel 4 Released Today
in Frameworks
Posted
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)