Skip to content

Finding duplicate column values in a CSV

I’m importing a CSV that has 3 columns, one of these columns could have duplicate records. I have 2 things to check: So far, I’m parsing the CSV file, once and checking that 1. (NAME is valid), which if it fails, it simply breaks out of the while loop and stops. I guess the question is, how I&#821…

pass a callback WITH arguments in PHP

I have a PHP library function expecting a callback with no arguments. I know I can pass an object’s method with array($this , ‘my_function_name’) but how can I give parameters to the my_function_name? I have found a solution using create_function but from PHP manual I see it has security iss…

MySQL Rows Disappearing (Mysteriously)

I have 3 tables A, B and C which are directly linked and should contain the same number of rows, the rows for each table being created together. I’ve recently noticed that after creating 1000 rows for test purposes (rows are definitely inserted, no transactions, system stable), and without any applicati…

cakephp: update hasmany related tables

For example, if we have: from http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html How should we do an update on the Comment table from the User controller given that all these data is submitted using one form? This is somehow the same as my question here: updating related tables in…

PHP cURL error code 60

Whilst trying to setup a php environment on windows (using wamp) to use the Amazon PHP SDK, when i try to run a sample test I get the following error: I have already added the following line to my php.ini which is the location of a certificate i created using this VBS script VBS-Script I have restarted my WAM…

Symfony how to return all logged in Active Users

I want to return all Logged in users of my application and render it in my Dashboard. The user_id and user_name should be retrieved from the session (I am using an external LDAP Library for …

one line if statement in php

I’d like to to some thing similar to javascripts var foo = true; foo && doSometing(); but this doesnt seem to work in php. I’m trying to add a class to a label if a condition is met …