Skip to content

Instantly share code, notes, and snippets.

<?php
//round 1
$json_file = file_get_contents('http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json');
$data = json_decode($json_file);
$i=0;
var_dump($json_file);
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~<br/>";
//round 2
$xml_file = simplexml_load_file('http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/data/mondial/mondial-3.0.xml');
<?php
//controller
//-------------------------------------
function index()
{
$this->load->model('list_four_mdl'); // load the file welcome_mdl.php
$data1['records'] = $this->list_four_mdl->get_fourn(); //
$data2['records2'] = $this->list_four_mdl->get_enga(); //
$data3['xxx']=$data1;
@nsssim
nsssim / find_field_in_db
Last active August 29, 2015 14:14
mysql
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('xxxxx','yyyyyy')
AND TABLE_SCHEMA='database_name';
//will find xxxxx and yyyyyy in the databae