I try to send curl request with my correct APP_ID, APP_SECRET etc. to the I need to get access_token from it, but get a FALSE and curl_error() print next message otherwise: My code is: When I move manually to the link above, I get access_token well. Why it doesn’t work with curl? Help, please. Answer An…
Tag: php
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̵…
Values inserted into database show weird characters
I am taking data in an xml feed from readability and inserting it into a database and then outputting it. The charset of the xml feed is UTF-8, my html page headers are also UTF-8. I even saved the …
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…
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 …
PHP static method call with variable class name and namespaces
I’m trying to call a static method for a namespaced class from another class with the same namespace. But the other class’ name is contained in a variable : Here is the Book class : My type variable contains a valid class name here Book. This class is in the same folder, and uses the same namespac…
Extract datas with ‘,’ from database to csv file
This is my code to extract datas from database to csv file. It’s working fine but now that I put it in my program where the datas have addresses, thus having commas ( , ), I’m having problem in printing it. This is how it looks like: It should be like this: The City and email are pushed to the