Coffee Related Articles

The Will Code 4 Latte Lady

Discuss This
Posted: 06/28 8:03 PM EST   |   Coffee Related Articles

June 2012 – The viral ‘Will Code 4 Latte’ lady was, for a short time, popular on the web. The lady was photographed holding a sign with those famous words, with the additional SQL/C# info.

SQL is the language used to interact with a database. Below is some sample code we wrote just for this article:

$q = ‘SELECT * from news’;
$r = mysqli_query($dbc, $q);

$news= array();

while (list($job) = mysqli_fetch_array($r, MYSQLI_NUM)) {
 $news[] = array(‘job’ => $job);
 }

The code above (incomplete) selects all data from the news table and puts each row of data into the $news array.

No output is generated, but the $news[] array now holds all of the data, provided there was data to retrieve.
The programmer could then output the data from the array, in a loop, going from [0] to sizeof($news).

Also try
foreach ($a as $key=> $value) {

echo $key.” – “.$value.”<br />”; // will output all key/values, you do not need to know the array length

}

 

The sample code is in PHP, not C# like the Will Code 4 Latte sign.

And, why is this useful, and why can’t this person find work? As great as it is to know SQL, you have to live in an area of the world that has use for this skill.

When you do find work you will earn way much more that a Latte.

The Latte Lady: Adelle Hartley from Sydney, Australia


We want your feedback!

You must be logged in to feedback.

Share Some Photos

The Movie Poster

Site Features


The K-Cup Insanity


Contact