<?php $db = new PDO( 'mysql:unix_socket=/cloudsql/hello-php-gae:my-cloudsql-instance;dbname=demo_db;charset=utf8', 'demo_user', 'demo_password' ); foreach($db->query('SELECT * FROM users') as $row) { echo $row['username'].' '.$row['first_name']; //etc... }
<?php $handle = fopen('gs://hello-php-gae-files/prime_numbers.txt','w'); fwrite($handle, "2"); for($i = 3; $i <= 2000; $i = $i + 2) { $j = 2; while($i % $j != 0) { if($j > sqrt($i)) { fwrite($handle, ", ".$i); break; } $j++; } } fclose($handle);
<?php $primes = explode(",", file_get_contents('gs://hello-php-gae-files/prime_numbers.txt') ); if(isset($primes[100])) echo "The 100th prime number is ".$primes[100];
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.