Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
Deepak Maurya
There is possibly also a very non-obvious reason why your admin interface is very slow. Magento has a module named Mage_AdminNotification. Try to disable that ext. Because what it does is query magentocommerce.com for new update messages. If their servers are slow your admin page waits and is in effect slow because of the network lag and loading of the external news. If you have secured your outgoing server connection through a firewall this can be even more frustrating, since the admin interface will wait for the timeout when it cannot reach magentocommerce.com
To disable it: go to System -> Configuration, scroll to the bottom and hit Advanced(in the Advanced section). Now disable Mage_AdminNotification and save!
Deepak Maurya
Try MySQL Workbench. It packs in very nice data modeling tools. Check out their screenshots for EER diagrams (Enhanced Entity Relationships, which are a notch up ER diagrams).
This isn’t CakePHP specific, but you can modify the options so that the foreign keys and join tables follow the conventions that CakePHP uses. This would simplify your data modeling process once you’ve put the rules in place.
Deepak Maurya
Try to use 2 alternatives way:
Set finish(); with use of current context
Set setResult(Activity.RESULT.CANCELLED);
Deepak Maurya
download the cake zip, unpack, delete the app folder, put your app folder in.
Deepak Maurya
I have checked my PHP init file (php.ini) and display errors is set and also error reporting is E_ALL. I have restarted my Apache web server.
I have even put these lines at the top of my script, and it doesn’t even catch simple parse errors. For example, I declare variables with a “$” and I don’t close statements”;”. But all my scripts show a blank page on these errors, but I want to actually see the errors in my browser output.
error_reporting(E_ALL);
ini_set(‘display_errors’, 1);
What is left to do?
Deepak Maurya
I have a variable in PHP, and I need its value in my JavaScript code. How can I get my variable from PHP to JavaScript?
I have code that looks like this:
getValue(); // makes an api and db call
?>
I have JavaScript code that needs val and looks along the lines of:
myPlugin.start($val); // tried this, didn’t work
// this didn’t work either
myPlugin.start( // this works sometimes, but sometimes it fails
Deepak Maurya
‘ Single quoted
The simplest way to specify a string is to enclose it in single quotes. Single quote is generally faster, and everything quoted inside treated as plain string.
Example:
echo ‘Start with a simple string’;
echo ‘String\’s apostrophe’;
echo ‘String with a php variable’.$name;
” Double quoted
Use double quotes in PHP to avoid having to use the period to separate code (Note: Use curly braces {} to include variables if you do not want to use concatenation (.) operator) in string.
Example:
echo “Start with a simple string”;
echo “String’s apostrophe”;
echo “String with a php variable {$name}”;
Is there a performance benefit single quote vs double quote in PHP?
Yes. It is slightly faster to use single quotes.
PHP won’t use additional processing to interpret what is inside the single quote. when you use double quotes PHP has to parse to check if there are any variables within the string
Deepak Maurya
I find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely.
It is very difficult to figure out what went wrong. I end up commenting out code, entering “echo” statements everywhere, etc. trying to narrow down the problem. But there surely must be a better way, right?.
So, is there a way to get PHP to produce a useful error message as Java does? Can anyone recommend good PHP debugging tips and techniques?
Deepak Maurya
310
44
Is there a simple way to convert one date format into another date format in PHP?
I have this:
$old_date = date(‘y-m-d-h-i-s’); // works
$middle = strtotime($old_date); // returns bool(false)
$new_date = date(‘Y-m-d H:i:s’, $middle); // returns 1970-01-01 00:00:00
But I’d of course like it to return a current date rather than the crack ‘o dawn. What am I doing wrong?
Deepak Maurya
SELECT cst_name, full_email, COUNT(*) FROM users GROUP BY cst_name, full_email HAVING COUNT(*) > 1
Simply group on both of the columns.
As I have noted the older ANSI standard is to keep all non-aggregated columns in the GROUP BY but this has changed with the idea of “functional dependency”: