Solved

( ! ) Warning: Illegal string offset  Error MYSQL PHP

Posted on 2016-09-28
62
67 Views
Last Modified: 2016-09-29
Here is my code. I'm getting an error on my SQL string. I cant figure it out. If I echo the array everything shows up fine. Help Help !

<?php
include ("Brewerydb.php");
 echo "<br> Step 2 GET beers from Brewery DB";
 
 
$apikey = '';

$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 
$params=array('/beers','p' => 1,);
$results = array();
try {
    
    // The first argument to request() is the endpoint you want to call
    // 'brewery/BrvKTz', 'beers', etc.
    // The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
} catch (Exception $e) {
    $results = array('error' => $e->getMessage());
}

var_dump($results);


$servername = "localhost";
$username = "root";
$password = "";
$dbname = "";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 


foreach($results as $result){
$sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV) VALUES ('{$result[0]['id']}', '{$result[0]['name']}', '{$result[0]['description']}', '{$result[0]['abv']}')";
//echo $result[0]['id'].' '.$result[0]['name'].' '.$result[0]['description'].' '.$result[0]['abv'].'<br/>';
}

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>

Open in new window

0
Comment
Question by:Ray Zuchowski
  • 32
  • 16
  • 12
62 Comments
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820588
Can you please copy and paste the exact error message?
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820593
Why do you need the array index as part of the variable reference? Doesn't the foreach put the particular array you want into a single dimensional array such that you no longer need the index?

ie This might work:
$sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV) 
VALUES ('{$result['id']}', '{$result['name']}',
 '{$result['description']}', '{$result['abv']}')";

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41820599
( ! ) Warning: Illegal string offset 'id' in C:\wamp64\www\GetBeers.php on line 39
Call Stack
#      Time      Memory      Function      Location
1      0.0009      244040      {main}( )      ...\GetBeers.php:0

( ! ) Warning: Illegal string offset 'name' in C:\wamp64\www\GetBeers.php on line 39
Call Stack
#      Time      Memory      Function      Location
1      0.0009      244040      {main}( )      ...\GetBeers.php:0

( ! ) Warning: Illegal string offset 'description' in C:\wamp64\www\GetBeers.php on line 39
Call Stack
#      Time      Memory      Function      Location
1      0.0009      244040      {main}( )      ...\GetBeers.php:0

( ! ) Warning: Illegal string offset 'abv' in C:\wamp64\www\GetBeers.php on line 39
Call Stack
#      Time      Memory      Function      Location
1      0.0009      244040      {main}( )      ...\GetBeers.php:0
0
 

Author Comment

by:Ray Zuchowski
ID: 41820605
I'm pulling the data from an API which basically if I do a Var_dump it exports the results I'm trying to copy. Here is an example of the Var_dump . I only need certain fields out of this, and I need it to be in a loop to copy all the info. Each page has 50 entries and there is like 1150 pages.

      49 =>
        array (size=8)
          'id' => string 'PvaOWz' (length=6)
          'name' => string '#40 Golden Lager' (length=16)
          'nameDisplay' => string '#40 Golden Lager' (length=16)
          'isOrganic' => string 'N' (length=1)
          'status' => string 'verified' (length=8)
          'statusDisplay' => string 'Verified' (length=8)
          'createDate' => string '2012-01-03 02:42:36' (length=19)
          'updateDate' => string '2012-03-22 13:04:49' (length=19)
  'status' => string 'success' (length=7)
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820615
If my suggested fix doesn't work, put this in the start of the foreach loop, with a dir path that can be written to (eg /tmp):
file_put_contents('/someDirPathThatYouChoose/logfile.txt', print_r($result,true)."\n",FILE_APPEND);

Open in new window


and then share the contents of the log file after you've run the script (desensitise data if necessary)
0
 

Author Comment

by:Ray Zuchowski
ID: 41820616
$result is a variable that doesn't exist outside of the For Each. The var_dump outputs data from $results.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820622
Here is the errors I'm getting from your suggestion.



( ! ) Notice: Undefined index: id in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Notice: Undefined index: name in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Notice: Undefined index: description in C:\wamp64\www\GetBeers.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Notice: Undefined index: abv in C:\wamp64\www\GetBeers.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'id' in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'name' in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'description' in C:\wamp64\www\GetBeers.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'abv' in C:\wamp64\www\GetBeers.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0004 243160 {main}( ) ...\GetBeers.php:0
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820624
The file_put_contents needs to go in the foreach loop. That way, the last line output to the log is the one causing the problem.
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41820625
Why do you have $result[0]['id']?

When you create the foreach loop
foreach($results as $result){

Open in new window

On each iteration $result is the array item i.e. the one with 'id' as an item - $result[0] is not defined - as the message suggests

Your code should therefore be
foreach($results as $result){
	$sql = "
		INSERT INTO masterbrewlist (
			BreweryDbId, 
			BeerName, 
			Description, 
			ABV) 
		VALUES (
		'{$result['id']}', 
		'{$result['name']}', 
		'{$result['description']}', 
		'{$result['abv']}')";
}

Open in new window

0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41820626
@Terry - apologies I see you already covered what I had in my last post.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820630
yes it extracted everything from the var_dump
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41820637
@Ray - have you tried the code in Terry's post and mine above. I am pretty sure that your problem was the index [0] you were using.
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820640
The one thing you haven't provided is the exact contents of $results (or just one line of data, from $result). It's likely you're trying to reference it in a way that doesn't match the structure.

If you can show us the structure of the data going into the foreach loop, we can probably tell you what's gone wrong. The print_r I put in the file_put_contents should provide that information.

It is also possible that just one $result record from the $results array is incorrect, in which case we need to track down why that's the case. Once the script has run, the log file should contains as it's last line the record that caused the failure, so I'm covering this possibility too.

Can you share the data structure as output to the log file?
0
 

Author Comment

by:Ray Zuchowski
ID: 41820641
<?php
include ("Brewerydb.php");
 echo "<br> Step 2 GET beers from Brewery DB";
 
 
$apikey = '';

$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 
$params=array('/beers','p' => 1,);
$results = array();
try {
    
    // The first argument to request() is the endpoint you want to call
    // 'brewery/BrvKTz', 'beers', etc.
    // The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
} catch (Exception $e) {
    $results = array('error' => $e->getMessage());
}

var_dump($results);


$servername = "localhost";
$username = "root";
$password = "password";
$dbname = "MyDb";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

foreach($results as $result){
	file_put_contents('/logfile.txt', print_r($result,true)."\n",FILE_APPEND);
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('{$result['id']}','{$result['name']}','{$result['description']}','{$result['abv']}')";
}


if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41820643
There is my updated code but these are the errors I'm getting. Sorry guys, I'm a noob with PHP I'm learning.



( ! ) Notice: Undefined index: id in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Notice: Undefined index: name in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Notice: Undefined index: description in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Notice: Undefined index: abv in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'id' in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'name' in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'description' in C:\wamp64\www\GetBeers.php on line 40


Call Stack


#

Time

Memory

Function

Location

1 0.0008 244120 {main}( ) ...\GetBeers.php:0
 


( ! ) Warning: Illegal string offset 'abv' in C:\wamp64\www\GetBeers.php on line 40
0
 

Author Comment

by:Ray Zuchowski
ID: 41820650
Here is log file.
logfile.txt
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820654
Ok, so the line you added should have written data to /logfile.txt (assuming the script has permissions to write to that file) so open up that file, and examine the contents. The last entry output to it should be the record that's failing. If you can copy and paste the contents of the file, or the last entry from it, we can see the data structure.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820655
Example of Var_dump from $results

array (size=5)
  'currentPage' => int 1
  'numberOfPages' => int 1154
  'totalResults' => int 57680
  'data' =>
    array (size=50)
      0 =>
        array (size=16)
          'id' => string 'cBLTUw' (length=6)
          'name' => string '"18" Imperial IPA 2' (length=19)
          'nameDisplay' => string '"18" Imperial IPA 2' (length=19)
          'description' => string 'Hop Heads this one's for you!  Checking in with 143 IBU's this ale punches you in the mouth with extreme bitterness then rounds out with toffee flavors and finishes with a citrus aroma.  Made with tons of US 2 Row Barley to get this to ABV 11.1%.' (length=246)
          'abv' => string '11.1' (length=4)
          'glasswareId' => int 5
          'srmId' => int 33
          'styleId' => int 43
          'isOrganic' => string 'N' (length=1)
          'status' => string 'verified' (length=8)
          'statusDisplay' => string 'Verified' (length=8)
          'createDate' => string '2013-01-20 21:38:15' (length=19)
          'updateDate' => string '2016-08-17 16:05:54' (length=19)
          'glass' =>
            array (size=3)
              ...
          'srm' =>
            array (size=3)
              ...
          'style' =>
            array (size=17)
              ...
      1 =>
        array (size=15)
          'id' => string 'ZsQEJt' (length=6)
          'name' => string '"633" American Pale Ale' (length=23)
          'nameDisplay' => string '"633" American Pale Ale' (length=23)
          'description' => string 'Our first beer has been aptly named "633" after the Regions telephone exchange for starters.  "If I could call a beer home, this would be the one." ~ Win

It is a mildly hoppy pale ale using a 2 row, vienna, and munich malts for body,color, and head retention. It is hopped with American west coast hops later in the boil giving it a nice citrus hop flavor and very mild aroma. Slight addition of a roasted caramel malt gives "633" it's signature 'sunset over the harbor glow'.' (length=479)
          'abv' => string '6.33' (length=4)
          'ibu' => string '25' (length=2)
          'availableId' => int 1
          'styleId' => int 25
          'isOrganic' => string 'N' (length=1)
          'status' => string 'verified' (length=8)
          'statusDisplay' => string 'Verified' (length=8)
          'createDate' => string '2015-04-20 21:43:59' (length=19)
          'updateDate' => string '2015-04-20 21:43:59' (length=19)
          'available' =>
            array (size=3)
              ...
          'style' =>
            array (size=17)
              ...
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820659
Cool, thanks. I think changing this line might fix the script.

foreach($results['data'] as $result){

Open in new window


(edited)
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41820662
We only need to see the errors - not the rest of the call stack
Take look at the error
( ! ) Notice: Undefined index: id in C:\wamp64\www\GetBeers.php on line 40
Look at line 40 of your code it is a closing }
Therefore the code you posted is not the code that generated the error.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820663
This is easier to read . I exported it as a CSV
logfile.csv
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41820666
Let me know how you go with that change to the foreach.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820670
Array
(
    [0] => Array
        (
            [id] => cBLTUw
            [name] => "18" Imperial IPA 2
            [nameDisplay] => "18" Imperial IPA 2
            [description] => Hop Heads this one's for you!  Checking in with 143 IBU's this ale punches you in the mouth with extreme bitterness then rounds out with toffee flavors and finishes with a citrus aroma.  Made with tons of US 2 Row Barley to get this to ABV 11.1%.
            [abv] => 11.1
            [glasswareId] => 5
            [srmId] => 33
            [styleId] => 43
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-01-20 21:38:15
            [updateDate] => 2016-08-17 16:05:54
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [srm] => Array
                (
                    [id] => 33
                    [name] => 33
                    [hex] => 520907
                )

            [style] => Array
                (
                    [id] => 43
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Imperial Stout
                    [shortName] => American Imperial Stout
                    [description] => Black in color, American-style imperial stouts typically have a high alcohol content. Generally characterized as very robust. The extremely rich malty flavor and aroma are balanced with assertive hopping and fruity-ester characteristics. Bitterness should be moderately high to very high and balanced with full sweet malt character. Roasted malt astringency and bitterness can be moderately perceived but should not overwhelm the overall character. Hop aroma is usually moderately-high to overwhelmingly hop-floral, -citrus or -herbal. Diacetyl (butterscotch) levels should be absent.
                    [ibuMin] => 50
                    [ibuMax] => 80
                    [abvMin] => 7
                    [abvMax] => 12
                    [srmMin] => 40
                    [srmMax] => 40
                    [ogMin] => 1.08
                    [fgMin] => 1.02
                    [fgMax] => 1.03
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:28:49
                )

        )

    [1] => Array
        (
            [id] => ZsQEJt
            [name] => "633" American Pale Ale
            [nameDisplay] => "633" American Pale Ale
            [description] => Our first beer has been aptly named "633" after the Regions telephone exchange for starters.  "If I could call a beer home, this would be the one." ~ Win

It is a mildly hoppy pale ale using a 2 row, vienna, and munich malts for body,color, and head retention. It is hopped with American west coast hops later in the boil giving it a nice citrus hop flavor and very mild aroma. Slight addition of a roasted caramel malt gives "633" it's signature 'sunset over the harbor glow'.
            [abv] => 6.33
            [ibu] => 25
            [availableId] => 1
            [styleId] => 25
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-04-20 21:43:59
            [updateDate] => 2015-04-20 21:43:59
            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 25
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Pale Ale
                    [shortName] => American Pale
                    [description] => American pale ales range from deep golden to copper in color. The style is characterized by fruity, floral and citrus-like American-variety hop character producing medium to medium-high hop bitterness, flavor, and aroma. Note that the "traditional" style of this beer has its origins with certain floral, fruity, citrus-like, piney, resinous, or sulfur-like American hop varietals. One or more of these hop characters is the perceived end, but the perceived hop characters may be a result of the skillful use of hops of other national origins. American pale ales have medium body and low to medium maltiness. Low caramel character is allowable. Fruity-ester flavor and aroma should be moderate to strong. Diacetyl should be absent or present at very low levels. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 30
                    [ibuMax] => 42
                    [abvMin] => 4.5
                    [abvMax] => 5.6
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.044
                    [fgMin] => 1.008
                    [fgMax] => 1.014
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:25:18
                )

        )

    [2] => Array
        (
            [id] => tmEthz
            [name] => "Admiral" Stache
            [nameDisplay] => "Admiral" Stache (2012)
            [description] => Milwaukee Brewing Co’s take on a classic European style. Baltic Porters are the stronger lager fermented cousin of the classic London Porter. The higher strength and cold fermentation help to create a smooth, less fruity porter, rich in roasted malt flavors and aromas. The “Admiral” Stache has a deep brown hue with a light caramel head. Toffee and milk chocolate dominate the flavor with subtle hints of dried fruit. One month of aging in Bourbon Barrels imparted a layer of vanilla and oak.

We first developed this beer in 2007. Our first attempted batch of beer at the 2nd street location was a Baltic Porter. What we ended up with became known as “Shake Down Nut Brown”. You can guess what went wrong from there… But, so many things right! Every year that has gone by, the beer has gotten a little bit stronger, in flavor and alcohol.

We use a black malt for the dark rich color and an extra special malt for the dried fruit flavors. Baltic Porters are fermented cold with a lager yeast. That long slow maturation creates a smooth flavor profile. The anticipation of the bourbon barrel aging it the most exciting part of this brew process. We want that oak character with hints of bourbon, we use 3rd run barrels for this result. Each batch has been slightly different from the last.
            [abv] => 7
            [ibu] => 23
            [glasswareId] => 5
            [srmId] => 37
            [availableId] => 4
            [styleId] => 104
            [isOrganic] => N
            [year] => 2012
            [labels] => Array
                (
                    [icon] => https://s3.amazonaws.com/brewerydbapi/beer/tmEthz/upload_3Jl1St-icon.png
                    [medium] => https://s3.amazonaws.com/brewerydbapi/beer/tmEthz/upload_3Jl1St-medium.png
                    [large] => https://s3.amazonaws.com/brewerydbapi/beer/tmEthz/upload_3Jl1St-large.png
                )

            [status] => verified
            [statusDisplay] => Verified
            [originalGravity] => 1.071
            [createDate] => 2012-09-09 13:35:27
            [updateDate] => 2015-12-16 18:47:43
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [srm] => Array
                (
                    [id] => 37
                    [name] => 37
                    [hex] => 3F0708
                )

            [available] => Array
                (
                    [id] => 4
                    [name] => Seasonal
                    [description] => Available at the same time of year, every year.
                )

            [style] => Array
                (
                    [id] => 104
                    [categoryId] => 9
                    [category] => Array
                        (
                            [id] => 9
                            [name] => Other Lager
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Baltic-Style Porter
                    [shortName] => Baltic Porter
                    [description] => A true smooth cold-fermented and cold lagered beer, brewed with lager yeast. Black to very deep ruby/garnet in color. Overall, Baltic Porters have a very smooth lagered character with distinctive caramelized sugars, licorice and chocolate-like character of roasted malts and dark sugars. Roasted dark malts should not contribute bitterness, or astringent roast character. A low degree of smokiness from malt may be evident. Debitterized roast malts are best used for this style. Because of its alcoholic strength, aroma may include gentle (low) lager fruitiness (berries, grapes, plums, not banana; ale-like fruitiness from warm temperature fermentation is not appropriate), complex alcohols, cocoa-like, roast malt (and sometimes coffee-like roast barley, yet not bitter). Hop aroma is very low, though a hint of floral or sweet hop aroma can complement aromatics and flavor without dominance. Baltic Porters are not hop bitter dominated and expressed as low to medium-low. Baltic porters range from having medium to full body complemented with a medium-low to medium level of malty sweetness. No butterscotch-like diacetyl or sweet corn-like dimethylsulfide (DMS) should be apparent in aroma or flavor.
                    [ibuMin] => 35
                    [ibuMax] => 40
                    [abvMin] => 7.5
                    [abvMax] => 9
                    [srmMin] => 40
                    [srmMax] => 40
                    [ogMin] => 1.072
                    [fgMin] => 1.016
                    [fgMax] => 1.022
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:41:46
                )

        )

    [3] => Array
        (
            [id] => b7SfHG
            [name] => "Ah Me Joy" Porter
            [nameDisplay] => "Ah Me Joy" Porter
            [description] => A robust porter style ale with a twist. This beer has moderate roastiness with a bitter finish, complemented by the sweetness of almond and coconut, which may remind you of a certain candy. Sit back with a pint and you'll say "ah, me joy!"
            [abv] => 5.4
            [ibu] => 51
            [srmId] => 40
            [styleId] => 19
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-02 20:42:02
            [updateDate] => 2015-11-02 20:42:03
            [srm] => Array
                (
                    [id] => 40
                    [name] => 40
                    [hex] => 36080A
                )

            [style] => Array
                (
                    [id] => 19
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Robust Porter
                    [shortName] => Robust Porter
                    [description] => Robust porters are black in color and have a roast malt flavor, often reminiscent of cocoa, but no roast barley flavor. These porters have a sharp bitterness of black malt without a highly burnt/charcoal flavor. Caramel and other malt sweetness should be present and in harmony with other distinguishing porter characters. Robust porters range from medium to full in body and have a malty sweetness. Hop bitterness is medium to high, with hop aroma and flavor ranging from negligible to medium. Diacetyl is acceptable at very low levels. Fruity esters should be evident, balanced with roast malt and hop bitterness.
                    [ibuMin] => 25
                    [ibuMax] => 40
                    [abvMin] => 5
                    [abvMax] => 6.5
                    [srmMin] => 30
                    [srmMax] => 30
                    [ogMin] => 1.045
                    [fgMin] => 1.008
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:21:45
                )

        )

    [4] => Array
        (
            [id] => zcJMId
            [name] => "Alternating Currant" Sour
            [nameDisplay] => "Alternating Currant" Sour
            [description] => Black Currant Kettle Sour.
            [abv] => 4.8
            [ibu] => 12
            [styleId] => 40
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 17:04:44
            [updateDate] => 2015-11-03 17:04:45
            [style] => Array
                (
                    [id] => 40
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Sour Ale
                    [shortName] => Sour
                    [description] => American sour ales can be very light to black or take on the color of added fruits or other ingredients. There is no Brettanomyces character in this style of beer. Wood- and barrel-aged sour ales are classified elsewhere. If acidity is present it is usually in the form of lactic, acetic and other organic acids naturally developed with acidified malt in the mash or in fermentation by the use of various microorganisms including certain bacteria and yeasts. Acidic character can be a complex balance of several types of acid and characteristics of age. The evolution of natural acidity develops balanced complexity. Residual flavors that come from liquids previously aged in a barrel such as bourbon or sherry should not be present. Wood vessels may be used during the fermentation and aging process, but wood-derived flavors such as vanillin must not be present. In darker versions, roasted malt, caramel-like and chocolate-like characters should be subtle in both flavor and aroma. American sour may have evident full range of hop aroma and hop bitterness with a full range of body. Estery and fruity-ester characters are evident, sometimes moderate and sometimes intense, yet balanced. Diacetyl and sweet corn-like dimethylsulfide (DMS) should not be perceived. Chill haze, bacteria and yeast-induced haze are allowable at low to medium levels at any temperature. Fruited American-Style Sour Ales will exhibit fruit flavors in harmonious balance with other characters.
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:28:32
                )

        )

    [5] => Array
        (
            [id] => UM8GL6
            [name] => "B" Street Pineapple Blonde
            [nameDisplay] => "B" Street Pineapple Blonde
            [description] => "B" Street Pineapple Blonde is the lightest beer we have on tap.  Our Pineapple Blonde is a great choice for those just being introduced to craft beer.  For those more familiar with ales, our Blonde is a full-bodied ale with a subtle savory pineapple flavor.
            [abv] => 4.6
            [srmId] => 5
            [styleId] => 36
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-04-28 18:27:33
            [updateDate] => 2015-07-26 15:02:51
            [srm] => Array
                (
                    [id] => 5
                    [name] => 5
                    [hex] => FBB123
                )

            [style] => Array
                (
                    [id] => 36
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Golden or Blonde Ale
                    [shortName] => Blonde
                    [description] => Golden or Blonde ales are straw to golden blonde in color. They have a crisp, dry palate, light to medium body, and light malt sweetness. Low to medium hop aroma may be present but does not dominate. Bitterness is low to medium. Fruity esters may be perceived but do not predominate. Diacetyl should not be perceived. Chill haze should be absent.
                    [ibuMin] => 15
                    [ibuMax] => 25
                    [abvMin] => 4
                    [abvMax] => 5
                    [srmMin] => 3
                    [srmMax] => 7
                    [ogMin] => 1.045
                    [fgMin] => 1.008
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:27:26
                )

        )

    [6] => Array
        (
            [id] => NIaY9C
            [name] => "B.B. Rodriguez" Double Brown
            [nameDisplay] => "B.B. Rodriguez" Double Brown
            [description] => Caramel. Walnut. Toast. Luxury.
            [abv] => 8.5
            [ibu] => 30
            [styleId] => 37
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 17:02:33
            [updateDate] => 2016-05-05 14:04:50
            [style] => Array
                (
                    [id] => 37
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Brown Ale
                    [shortName] => American Brown
                    [description] => American brown ales range from deep copper to brown in color. Roasted malt caramel-like and chocolate-like characters should be of medium intensity in both flavor and aroma. American brown ales have evident low to medium hop flavor and aroma, medium to high hop bitterness, and a medium body. Estery and fruity-ester characters should be subdued. Diacetyl should not be perceived. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 25
                    [ibuMax] => 45
                    [abvMin] => 4
                    [abvMax] => 6.4
                    [srmMin] => 15
                    [srmMax] => 26
                    [ogMin] => 1.04
                    [fgMin] => 1.01
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:27:35
                )

        )

    [7] => Array
        (
            [id] => PBEXhV
            [name] => "Bison Eye Rye" Pale Ale | 2 of 4 Part Pale Ale Series
            [nameDisplay] => "Bison Eye Rye" Pale Ale | 2 of 4 Part Pale Ale Series
            [description] => The second in the rotating 4-part series of pale ales explores the adventurous boundaries of balancing various hops and unique malts. This particular brew was crafted with a healthy dose of toasted rye malt and a bodacious amount of New Zealand hops. Tropical aromas of melon and pineapple are balanced with a touch of sweet honey and a refreshing snap due to the mix of bittering hops and rye. Unfiltered, adventurous and crushable.
            [abv] => 5.8
            [ibu] => 51
            [srmId] => 8
            [styleId] => 25
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2016-05-11 15:05:00
            [updateDate] => 2016-05-11 15:05:00
            [srm] => Array
                (
                    [id] => 8
                    [name] => 8
                    [hex] => EA8F00
                )

            [style] => Array
                (
                    [id] => 25
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Pale Ale
                    [shortName] => American Pale
                    [description] => American pale ales range from deep golden to copper in color. The style is characterized by fruity, floral and citrus-like American-variety hop character producing medium to medium-high hop bitterness, flavor, and aroma. Note that the "traditional" style of this beer has its origins with certain floral, fruity, citrus-like, piney, resinous, or sulfur-like American hop varietals. One or more of these hop characters is the perceived end, but the perceived hop characters may be a result of the skillful use of hops of other national origins. American pale ales have medium body and low to medium maltiness. Low caramel character is allowable. Fruity-ester flavor and aroma should be moderate to strong. Diacetyl should be absent or present at very low levels. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 30
                    [ibuMax] => 42
                    [abvMin] => 4.5
                    [abvMax] => 5.6
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.044
                    [fgMin] => 1.008
                    [fgMax] => 1.014
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:25:18
                )

        )

    [8] => Array
        (
            [id] => wRmmdv
            [name] => "California Crude" Black IPA
            [nameDisplay] => "California Crude" Black IPA
            [description] => Black ale that is aggressively hopped to balance the malt character. This beer is rich and robust with the additions of black malt for a creamy finish.
            [abv] => 7.6
            [ibu] => 80
            [styleId] => 41
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-07-27 14:04:42
            [updateDate] => 2015-03-18 18:14:44
            [style] => Array
                (
                    [id] => 41
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Black Ale
                    [shortName] => Black Ale
                    [description] => American-style Black Ales are very dark to black and perceived to have medium high to high hop bitterness, flavor and aroma with medium-high alcohol content, balanced with a medium body. Fruity, floral and herbal character from hops of all origins may contribute character. The style is further characterized by a balanced and moderate degree of caramel malt and dark roasted malt flavor and aroma. High astringency and high degree of burnt roast malt character should be absent.
                    [ibuMin] => 50
                    [ibuMax] => 70
                    [abvMin] => 6
                    [abvMax] => 7.5
                    [srmMin] => 35
                    [srmMax] => 35
                    [ogMin] => 1.056
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:28:36
                )

        )

    [9] => Array
        (
            [id] => EPYNpW
            [name] => "C’est Noir" Imperial Stout
            [nameDisplay] => "C’est Noir" Imperial Stout
            [description] => 10.8% ABV 70 IBU’s A rich and creamy stout with loads of roasted barley and roasted oats infused with 70 IBU’s of hop bitterness to balance this really big beer. (SAY NOIR)
            [abv] => 10.8
            [ibu] => 70
            [styleId] => 16
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-03-18 18:19:54
            [updateDate] => 2015-03-18 18:19:55
            [style] => Array
                (
                    [id] => 16
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => British-Style Imperial Stout
                    [shortName] => British Imperial Stout
                    [description] => Dark copper to very dark brown, British-style imperial stouts typically have high alcohol content. The extremely rich malty flavor (often characterized as toffee-like or caramel-like) and aroma are balanced with medium hopping and high fruity-ester characteristics. Bitterness should be moderate and balanced with sweet malt character. The bitterness may be higher in the darker versions. Roasted malt astringency is very low or absent. Bitterness should not overwhelm the overall character. Hop aroma can be subtle to moderately hop-floral, -citrus or -herbal. Diacetyl (butterscotch) levels should be absent.
                    [ibuMin] => 45
                    [ibuMax] => 65
                    [abvMin] => 7
                    [abvMax] => 12
                    [srmMin] => 20
                    [srmMax] => 35
                    [ogMin] => 1.08
                    [fgMin] => 1.02
                    [fgMax] => 1.03
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:22:41
                )

        )

    [10] => Array
        (
            [id] => AXmvOd
            [name] => "Dust Up" Cloudy Pale Ale | 1 of 4 Part Pale Ale Series
            [nameDisplay] => "Dust Up" Cloudy Pale Ale | 1 of 4 Part Pale Ale Series
            [description] => The Pale Ale series will feature 4 distinct variations within the Pale Ale category. "Dust Up" Cloudy Pale Ale, the first of the series, showcases caramelized wheat, an abundant amount of earthy forest hops and finishes crisp and snappy. Unfiltered, untamed, yet friendly to consume.
            [abv] => 5.4
            [ibu] => 54
            [srmId] => 11
            [styleId] => 25
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2016-05-11 15:02:31
            [updateDate] => 2016-05-11 15:02:32
            [srm] => Array
                (
                    [id] => 11
                    [name] => 11
                    [hex] => D77200
                )

            [style] => Array
                (
                    [id] => 25
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Pale Ale
                    [shortName] => American Pale
                    [description] => American pale ales range from deep golden to copper in color. The style is characterized by fruity, floral and citrus-like American-variety hop character producing medium to medium-high hop bitterness, flavor, and aroma. Note that the "traditional" style of this beer has its origins with certain floral, fruity, citrus-like, piney, resinous, or sulfur-like American hop varietals. One or more of these hop characters is the perceived end, but the perceived hop characters may be a result of the skillful use of hops of other national origins. American pale ales have medium body and low to medium maltiness. Low caramel character is allowable. Fruity-ester flavor and aroma should be moderate to strong. Diacetyl should be absent or present at very low levels. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 30
                    [ibuMax] => 42
                    [abvMin] => 4.5
                    [abvMax] => 5.6
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.044
                    [fgMin] => 1.008
                    [fgMax] => 1.014
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:25:18
                )

        )

    [11] => Array
        (
            [id] => c5pZg5
            [name] => "EVL1" Imperial Red Ale
            [nameDisplay] => "EVL1" Imperial Red Ale
            [description] => 10.4% ABV 64 IBU’s Born from a Robust Porter recipe, it shows it origins with coffee and roasted malt notes. A kicked-up red ale with a deep copper red color and a rich, malty sweet flavor.
            [abv] => 10.4
            [ibu] => 64
            [styleId] => 33
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-03-18 18:17:15
            [updateDate] => 2015-03-18 18:17:15
            [style] => Array
                (
                    [id] => 33
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Imperial Red Ale
                    [shortName] => Imperial Red
                    [description] => Imperial Red Ales are deep amber to dark copper/reddish brown. A small amount of chill haze is allowable at cold temperatures. Fruity-ester aroma is medium. Hop aroma is intense, arising from any variety of hops. Medium to high caramel malt character is present. Hop flavor is intense, and balanced with other beer characters. They may use any variety of hops. Hop bitterness is intense. Alcohol content is very high and of notable character. Complex alcohol flavors may be evident. Fruity-ester flavors are medium. Diacetyl should not be perceived. Body is full.
                    [ibuMin] => 55
                    [ibuMax] => 85
                    [abvMin] => 7.9
                    [abvMax] => 10.5
                    [srmMin] => 10
                    [srmMax] => 15
                    [ogMin] => 1.08
                    [fgMin] => 1.02
                    [fgMax] => 1.028
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 17:05:43
                )

        )

    [12] => Array
        (
            [id] => xBKAka
            [name] => "Galactic Wrath" IPA
            [nameDisplay] => "Galactic Wrath" IPA
            [description] => In August 2012, for the First Year Anniversary at our Tap Room and Restaurant, we decided to take two of our favorite Dust Bowl beers…Galaxy Pale Ale and Son of Wrath Double IPA…and formulate a new IPA recipe using elements from both beers. The result was a delicious, bold IPA with the fruity, citrus character and malt backbone of Son of Wrath, as well as the tropical aroma and easy drinkability of Galaxy Pale. It was so popular with our fans, we decided to brew more.
            [abv] => 7.5
            [ibu] => 75
            [availableId] => 2
            [styleId] => 30
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-03-25 20:28:19
            [updateDate] => 2015-03-25 20:28:19
            [available] => Array
                (
                    [id] => 2
                    [name] => Limited
                    [description] => Limited availability.
                )

            [style] => Array
                (
                    [id] => 30
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style India Pale Ale
                    [shortName] => American IPA
                    [description] => American-style India pale ales are perceived to have medium-high to intense hop bitterness, flavor and aroma with medium-high alcohol content. The style is further characterized by floral, fruity, citrus-like, piney, resinous, or sulfur-like American-variety hop character. Note that one or more of these American-variety hop characters is the perceived end, but the hop characters may be a result of the skillful use of hops of other national origins. The use of water with high mineral content results in a crisp, dry beer. This pale gold to deep copper-colored ale has a full, flowery hop aroma and may have a strong hop flavor (in addition to the perception of hop bitterness). India pale ales possess medium maltiness which contributes to a medium body. Fruity-ester flavors and aromas are moderate to very strong. Diacetyl can be absent or may be perceived at very low levels. Chill and/or hop haze is allowable at cold temperatures. (English and citrus-like American hops are considered enough of a distinction justifying separate American-style IPA and English-style IPA categories or subcategories. Hops of other origins may be used for bitterness or approximating traditional American or English character. See English-style India Pale Ale
                    [ibuMin] => 50
                    [ibuMax] => 70
                    [abvMin] => 6.3
                    [abvMax] => 7.5
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.06
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:37
                )

        )

    [13] => Array
        (
            [id] => Hr5A0t
            [name] => "God Country" Kolsch
            [nameDisplay] => "God Country" Kolsch
            [description] => Good, dense head retention is desirable. Light pearapple-Riesling wine-like fruitiness may be apparent, but is not necessary for this style. Caramel character should not be evident. The body is light to medium-light. This beer has low hop flavor and aroma with medium bitterness. Wheat can be used in brewing this beer. Ale yeast is used for fermentation, though lager yeast is sometimes used in the bottle or final cold conditioning process. Fruity esters should be minimally perceived, if at all. Chill haze should be absent.
            [abv] => 5.6
            [ibu] => 28.2
            [srmId] => 5
            [availableId] => 1
            [styleId] => 45
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-04-28 20:21:56
            [updateDate] => 2016-05-05 14:07:35
            [srm] => Array
                (
                    [id] => 5
                    [name] => 5
                    [hex] => FBB123
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 45
                    [categoryId] => 4
                    [category] => Array
                        (
                            [id] => 4
                            [name] => German Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => German-Style Kölsch / Köln-Style Kölsch
                    [shortName] => Kölsch
                    [description] => Kölsch is warm fermented and aged at cold temperatures (German ale or alt-style beer). Kölsch is characterized by a golden to straw color and a slightly dry, subtly sweet softness on the palate, yet crisp. Good, dense head retention is desirable. Light pearapple-Riesling wine-like fruitiness may be apparent, but is not necessary for this style. Caramel character should not be evident. The body is light to medium-light. This beer has low hop flavor and aroma with medium bitterness. Wheat can be used in brewing this beer. Ale yeast is used for fermentation, though lager yeast is sometimes used in the bottle or final cold conditioning process. Fruity esters should be minimally perceived, if at all. Chill haze should be absent.
                    [ibuMin] => 18
                    [ibuMax] => 25
                    [abvMin] => 4.8
                    [abvMax] => 5.3
                    [srmMin] => 4
                    [srmMax] => 6
                    [ogMin] => 1.042
                    [fgMin] => 1.006
                    [fgMax] => 1.01
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:29:04
                )

        )

    [14] => Array
        (
            [id] => UjFyXJ
            [name] => "Hey Victor" Smoked Porter
            [nameDisplay] => "Hey Victor" Smoked Porter
            [description] => Rooted in Western pop culture, our porter is named for the film, Smoke Signals, and is also related to Sherman Alexie’s story, “This is What it Means to Say, ‘Phoenix, Arizona.’”

Our smoked porter is very approachable; it’s not overly smoky and its blend of malts (Maris Otter, English Brown and chocolate) and hops (East Kent Golding, & Fuggle) will remind you of hikes, s’mores and cool, dusky campfires in the Snowies. Take a growler to the mountains and enjoy its rich color and flavor.
            [abv] => 5.5
            [styleId] => 129
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2014-09-18 18:42:18
            [updateDate] => 2015-05-20 13:48:06
            [style] => Array
                (
                    [id] => 129
                    [categoryId] => 11
                    [category] => Array
                        (
                            [id] => 11
                            [name] => Hybrid/mixed Beer
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Smoke Beer (Lager or Ale)
                    [shortName] => Smoke Beer
                    [description] => Any style of beer can be smoked; the goal is to reach a balance between the style's character and the smoky properties. Type of wood or other sources of smoke should be specified as well as the style the beer is based upon.
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:45:19
                )

        )

    [15] => Array
        (
            [id] => 5UcMBc
            [name] => "Ignition" IPA
            [nameDisplay] => "Ignition" IPA
            [description] => This medium amber beer is infused with a blend of 2-row malted barley and caramel malts. Its balance acquired by using a combination of Pacific Northwest hops for bitterness and aroma.
            [abv] => 6.6
            [ibu] => 45
            [glasswareId] => 5
            [availableId] => 1
            [styleId] => 30
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-07-27 14:02:13
            [updateDate] => 2015-03-18 18:05:08
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 30
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style India Pale Ale
                    [shortName] => American IPA
                    [description] => American-style India pale ales are perceived to have medium-high to intense hop bitterness, flavor and aroma with medium-high alcohol content. The style is further characterized by floral, fruity, citrus-like, piney, resinous, or sulfur-like American-variety hop character. Note that one or more of these American-variety hop characters is the perceived end, but the hop characters may be a result of the skillful use of hops of other national origins. The use of water with high mineral content results in a crisp, dry beer. This pale gold to deep copper-colored ale has a full, flowery hop aroma and may have a strong hop flavor (in addition to the perception of hop bitterness). India pale ales possess medium maltiness which contributes to a medium body. Fruity-ester flavors and aromas are moderate to very strong. Diacetyl can be absent or may be perceived at very low levels. Chill and/or hop haze is allowable at cold temperatures. (English and citrus-like American hops are considered enough of a distinction justifying separate American-style IPA and English-style IPA categories or subcategories. Hops of other origins may be used for bitterness or approximating traditional American or English character. See English-style India Pale Ale
                    [ibuMin] => 50
                    [ibuMax] => 70
                    [abvMin] => 6.3
                    [abvMax] => 7.5
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.06
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:37
                )

        )

    [16] => Array
        (
            [id] => mrVjY4
            [name] => "Jemez Field Notes" Golden Lager
            [nameDisplay] => "Jemez Field Notes" Golden Lager
            [description] => This straw-blond lager is an easy going brew created to help celebrate the oncoming warm summer months. Luke chose a variety of pilsner malts, to convey delightful bready notes, an even mouthfeel and a clean, refreshing finish. Jemez Field Notes pairs well with exploring the outdoors and getting dirty in the field.
            [abv] => 4.9
            [ibu] => 20
            [srmId] => 5
            [styleId] => 36
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2016-05-11 15:04:06
            [updateDate] => 2016-05-11 15:04:06
            [srm] => Array
                (
                    [id] => 5
                    [name] => 5
                    [hex] => FBB123
                )

            [style] => Array
                (
                    [id] => 36
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Golden or Blonde Ale
                    [shortName] => Blonde
                    [description] => Golden or Blonde ales are straw to golden blonde in color. They have a crisp, dry palate, light to medium body, and light malt sweetness. Low to medium hop aroma may be present but does not dominate. Bitterness is low to medium. Fruity esters may be perceived but do not predominate. Diacetyl should not be perceived. Chill haze should be absent.
                    [ibuMin] => 15
                    [ibuMax] => 25
                    [abvMin] => 4
                    [abvMax] => 5
                    [srmMin] => 3
                    [srmMax] => 7
                    [ogMin] => 1.045
                    [fgMin] => 1.008
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:27:26
                )

        )

    [17] => Array
        (
            [id] => 54rSgo
            [name] => "Jemmy Dean" Breakfast Stout
            [nameDisplay] => "Jemmy Dean" Breakfast Stout
            [description] => The stout style lends itself well to pairing with coffee.  Our Jemmy stout uses over eight different malts and has a complexity that is complemented by our special cold-pressed Java Vino blend added into the serving tank - yielding our "Jemmy Dean" breakfast stout.
            [glasswareId] => 5
            [availableId] => 1
            [styleId] => 20
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-09-29 17:22:22
            [updateDate] => 2015-04-24 13:24:02
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 20
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Sweet or Cream Stout
                    [shortName] => Sweet Stout
                    [description] => Sweet stouts, also referred to as cream stouts, have less roasted bitter flavor and a full-bodied mouthfeel. The style can be given more body with milk sugar (lactose) before bottling. Malt sweetness, chocolate, and caramel flavor should dominate the flavor profile and contribute to the aroma. Hops should balance and suppress some of the sweetness without contributing apparent flavor or aroma. The overall impression should be sweet and full-bodied.
                    [ibuMin] => 15
                    [ibuMax] => 25
                    [abvMin] => 3
                    [abvMax] => 6
                    [srmMin] => 40
                    [srmMax] => 40
                    [ogMin] => 1.045
                    [fgMin] => 1.012
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:24:41
                )

        )

    [18] => Array
        (
            [id] => JsKjkk
            [name] => "Mauvaises Choses"
            [nameDisplay] => "Mauvaises Choses"
            [description] => …meaning “Very Bad Things” in French…

As the name suggests this beer is naughty. She creeps up on you and packs a punch, but the best part about her…she never talks back 

A Belgian Golden Ale brewed with California Golden raisins and Canadian Maple Syrup. Trappist yeast creates a strong phenolic aroma reminiscent of passion fruit, plums, and mangos. French and Czech hops add a complex flavor, while taking care not to obstruct the delicate phenols of the Belgian yeast.

Drink up, but be careful, she’s a feisty one!
            [abv] => 7
            [ibu] => 30
            [glasswareId] => 8
            [styleId] => 63
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-04-12 00:01:51
            [updateDate] => 2014-10-13 14:54:52
            [glass] => Array
                (
                    [id] => 8
                    [name] => Tulip
                    [createDate] => 2012-01-03 02:41:33
                )

            [style] => Array
                (
                    [id] => 63
                    [categoryId] => 5
                    [category] => Array
                        (
                            [id] => 5
                            [name] => Belgian And French Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Belgian-Style Pale Strong Ale
                    [shortName] => Belgian Pale Strong
                    [description] => Belgian pale strong ales are pale to golden in color with relatively light body for a beer of its alcoholic strength. Often brewed with light colored Belgian "candy" sugar, these beers are well attenuated. The perception of hop bitterness is medium-low to medium -high, with hop flavor and aroma also in this range. These beers are highly attenuated and have a perceptively deceiving high alcoholic character-being light to medium bodied rather than full bodied. The intensity of malt character should be low to medium, often surviving along with a complex fruitiness. Very little or no diacetyl is perceived. Herbs and spices are sometimes used to delicately flavor these strong ales. Low levels of phenolic spiciness from yeast byproducts may also be perceived. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 20
                    [ibuMax] => 50
                    [abvMin] => 7
                    [abvMax] => 11
                    [srmMin] => 4
                    [srmMax] => 10
                    [ogMin] => 1.064
                    [fgMin] => 1.012
                    [fgMax] => 1.024
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:32:16
                )

        )

    [19] => Array
        (
            [id] => b7WWL6
            [name] => "Mike Saw a Sasquatch" Session Ale
            [nameDisplay] => "Mike Saw a Sasquatch" Session Ale
            [description] => The true Summer Ale of Central Oregon! A Golden Ale, light and smooth. You can taste the craftsmanship in this easy drinking ale with a smooth blend of Cascade and Sterling hops and finished with a touch of Honey malt to balance it out. This is a great introduction if you are new to the world of Craft Brewing.  For established craft enthusiasts, 10 Barrel Summer Ale is a good reprieve from overly hopped and overly malty alternatives.
            [abv] => 4.7
            [ibu] => 26
            [glasswareId] => 5
            [availableId] => 1
            [styleId] => 36
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-01-03 02:44:19
            [updateDate] => 2015-05-22 02:27:37
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 36
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Golden or Blonde Ale
                    [shortName] => Blonde
                    [description] => Golden or Blonde ales are straw to golden blonde in color. They have a crisp, dry palate, light to medium body, and light malt sweetness. Low to medium hop aroma may be present but does not dominate. Bitterness is low to medium. Fruity esters may be perceived but do not predominate. Diacetyl should not be perceived. Chill haze should be absent.
                    [ibuMin] => 15
                    [ibuMax] => 25
                    [abvMin] => 4
                    [abvMax] => 5
                    [srmMin] => 3
                    [srmMax] => 7
                    [ogMin] => 1.045
                    [fgMin] => 1.008
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:27:26
                )

        )

    [20] => Array
        (
            [id] => HXmS9k
            [name] => "My" Bock
            [nameDisplay] => "My" Bock
            [description] => Amber, malty and not too heavy, all around favorite even for the drinkers of the yellow fizzy stuff
            [abv] => 6
            [glasswareId] => 5
            [availableId] => 1
            [styleId] => 88
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-01-03 02:42:36
            [updateDate] => 2014-11-11 15:04:34
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 88
                    [categoryId] => 7
                    [category] => Array
                        (
                            [id] => 7
                            [name] => European-germanic Lager
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Traditional German-Style Bock
                    [shortName] => Bock
                    [description] => Traditional bocks are made with all malt and are strong, malty, medium- to full-bodied, bottom-fermented beers with moderate hop bitterness that should increase proportionately with the starting gravity. Malt character should be a balance of sweetness and toasted/nut-like malt; not caramel. Hop flavor should be low and hop aroma should be very low. Bocks can range in color from deep copper to dark brown. Fruity esters should be minimal. Diacetyl should be absent.
                    [ibuMin] => 20
                    [ibuMax] => 30
                    [abvMin] => 6.3
                    [abvMax] => 7.5
                    [srmMin] => 20
                    [srmMax] => 30
                    [ogMin] => 1.066
                    [fgMin] => 1.018
                    [fgMax] => 1.024
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:38:54
                )

        )

    [21] => Array
        (
            [id] => giqbO2
            [name] => "Not Just Some" Oatmeal Stout
            [nameDisplay] => "Not Just Some" Oatmeal Stout
            [description] => Made with two-row pale malt, dark chocolate malt, black malt, and flaked oats - this rich stout is brewed with twelve additions of Fuggle hops.  Originally Just Some Oatmeal Stout, the name was changed by popular demand as this truly is unlike any ordinary stout!
            [styleId] => 21
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-01-03 02:42:36
            [updateDate] => 2015-06-05 15:27:01
            [style] => Array
                (
                    [id] => 21
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Oatmeal Stout
                    [shortName] => Oatmeal Stout
                    [description] => Oatmeal stouts include oatmeal in their grist, resulting in a pleasant, full flavor and a smooth profile that is rich without being grainy. A roasted malt character which is caramel-like and chocolate-like should be evident - smooth and not bitter. Coffee-like roasted barley and roasted malt aromas (chocolate and nut-like) are prominent. Color is dark brown to black. Bitterness is moderate, not high. Hop flavor and aroma are optional but should not overpower the overall balance if present. This is a medium- to full- bodied beer, with minimal fruity esters. Diacetyl should be absent or at extremely low levels. Original gravity range and alcohol levels are indicative of English tradition of oatmeal stout.
                    [ibuMin] => 20
                    [ibuMax] => 40
                    [abvMin] => 3.8
                    [abvMax] => 6
                    [srmMin] => 20
                    [srmMax] => 20
                    [ogMin] => 1.038
                    [fgMin] => 1.008
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:22:53
                )

        )

    [22] => Array
        (
            [id] => HhyVO1
            [name] => "Pinch" Pilsner
            [nameDisplay] => "Pinch" Pilsner
            [abv] => 4.9
            [ibu] => 25
            [styleId] => 98
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 16:58:17
            [updateDate] => 2015-11-03 16:58:17
            [style] => Array
                (
                    [id] => 98
                    [categoryId] => 8
                    [category] => Array
                        (
                            [id] => 8
                            [name] => North American Lager
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => American-Style Pilsener
                    [shortName] => American Pilsener
                    [description] => This classic and unique pre-Prohibition American-style Pilsener is straw to deep gold in color. Hop bitterness, flavor and aroma are medium to high, and use of noble-type hops for flavor and aroma is preferred. Up to 25 percent corn and/or rice in the grist should be used. Malt flavor and aroma are medium. This is a light-medium to medium-bodied beer. Sweet corn-like dimethylsulfide (DMS), fruity esters and American hop-derived citrus flavors or aromas should not be perceived. Diacetyl is not acceptable. There should be no chill haze. Competition organizers may wish to subcategorize this style into rice and corn subcategories.
                    [ibuMin] => 25
                    [ibuMax] => 40
                    [abvMin] => 5
                    [abvMax] => 6
                    [srmMin] => 3
                    [srmMax] => 6
                    [ogMin] => 1.045
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:40:08
                )

        )

    [23] => Array
        (
            [id] => HZ9xM2
            [name] => "Ray Brown" Porter
            [nameDisplay] => "Ray Brown" Porter
            [description] => Now that the weather's turned a tad darker, your beer should, too. Get cozy with this ebony beauty, a brown porter that starts with notes of milky light chocolate and vanilla bean before morphing into a winter wonderland of mild coffee and hazelnuts. It's dark, tempting, and delicious, just the way longtime loyal customer Ray Brown likes it.
            [abv] => 5.8
            [ibu] => 30
            [styleId] => 18
            [isOrganic] => Y
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-05-11 17:52:07
            [updateDate] => 2015-05-11 17:52:07
            [style] => Array
                (
                    [id] => 18
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Brown Porter
                    [shortName] => Brown Porter
                    [description] => Brown porters are mid to dark brown (may have red tint) in color. No roast barley or strong burnt/black malt character should be perceived. Low to medium malt sweetness, caramel and chocolate is acceptable along with medium hop bitterness. This is a lightto medium-bodied beer. Fruity esters are acceptable. Hop flavor and aroma may vary from being negligible to medium in character.
                    [ibuMin] => 20
                    [ibuMax] => 30
                    [abvMin] => 4.5
                    [abvMax] => 6
                    [srmMin] => 20
                    [srmMax] => 35
                    [ogMin] => 1.04
                    [fgMin] => 1.006
                    [fgMax] => 1.014
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:21:43
                )

        )

    [24] => Array
        (
            [id] => ETaM11
            [name] => "Roux 40" Red IPA
            [nameDisplay] => "Roux 40" Red IPA
            [abv] => 6.7
            [ibu] => 50
            [styleId] => 30
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2016-06-13 12:19:19
            [updateDate] => 2016-06-13 12:19:19
            [style] => Array
                (
                    [id] => 30
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style India Pale Ale
                    [shortName] => American IPA
                    [description] => American-style India pale ales are perceived to have medium-high to intense hop bitterness, flavor and aroma with medium-high alcohol content. The style is further characterized by floral, fruity, citrus-like, piney, resinous, or sulfur-like American-variety hop character. Note that one or more of these American-variety hop characters is the perceived end, but the hop characters may be a result of the skillful use of hops of other national origins. The use of water with high mineral content results in a crisp, dry beer. This pale gold to deep copper-colored ale has a full, flowery hop aroma and may have a strong hop flavor (in addition to the perception of hop bitterness). India pale ales possess medium maltiness which contributes to a medium body. Fruity-ester flavors and aromas are moderate to very strong. Diacetyl can be absent or may be perceived at very low levels. Chill and/or hop haze is allowable at cold temperatures. (English and citrus-like American hops are considered enough of a distinction justifying separate American-style IPA and English-style IPA categories or subcategories. Hops of other origins may be used for bitterness or approximating traditional American or English character. See English-style India Pale Ale
                    [ibuMin] => 50
                    [ibuMax] => 70
                    [abvMin] => 6.3
                    [abvMax] => 7.5
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.06
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:37
                )

        )

    [25] => Array
        (
            [id] => Gb2aAs
            [name] => "Small Batch" Hazelwood Farmhouse IPA
            [nameDisplay] => "Small Batch" Hazelwood Farmhouse IPA
            [abv] => 6
            [styleId] => 72
            [isOrganic] => Y
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-07-12 20:00:58
            [updateDate] => 2015-07-12 20:00:58
            [style] => Array
                (
                    [id] => 72
                    [categoryId] => 5
                    [category] => Array
                        (
                            [id] => 5
                            [name] => Belgian And French Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => French & Belgian-Style Saison
                    [shortName] => Saison
                    [description] => Beers in this category are golden to deep amber in color. There may be quite a variety of characters within this style. Generally: They are light to medium in body. Malt aroma is low to medium-low. Esters are medium to high in  aroma, while, complex alcohols, herbs, spices, low Brettanomyces character and even clove and smoke-like phenolics may or may not be evident in the overall balanced beer. Hop aroma and flavor may be at low to medium levels. Malt flavor is low but provides foundation for the overall balance. Hop bitterness is moderate to moderately assertive. Herb and/or spice flavors, including black pepper-like notes, may or may not be evident. Fruitiness from fermentation is generally in character. A balanced small amount of sour or acidic flavors is acceptable when in balance with other components. Earthy, cellar-like, musty aromas are okay. Diacetyl should not be perceived. Chill or slight yeast haze is okay. Often bottle conditioned with some yeast character and high carbonation. French & Belgian-Style Saison may have Brettanomyces characters that are slightly acidity, fruity, horsey, goaty and/or leather-like.
                    [ibuMin] => 20
                    [ibuMax] => 40
                    [abvMin] => 4.5
                    [abvMax] => 8.5
                    [srmMin] => 4
                    [srmMax] => 14
                    [ogMin] => 1.055
                    [fgMin] => 1.004
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:34:55
                )

        )

    [26] => Array
        (
            [id] => TAtY2B
            [name] => "Sneaky Devil" Double IPA
            [nameDisplay] => "Sneaky Devil" Double IPA
            [description] => A light golden double-IPA with plenty of body and malt character to match the aggressive hoppiness. Blends of Columbus and Centennial hops round out the aroma. Don’t let the light color fool you. This beer packs a punch.
            [abv] => 7.8
            [ibu] => 80
            [glasswareId] => 6
            [availableId] => 1
            [styleId] => 31
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-07-27 14:02:12
            [updateDate] => 2015-03-18 18:12:38
            [glass] => Array
                (
                    [id] => 6
                    [name] => Snifter
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 31
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Imperial or Double India Pale Ale
                    [shortName] => Imperial IPA
                    [description] => Imperial or Double India Pale Ales have intense hop bitterness, flavor and aroma. Alcohol content is medium-high to high and notably evident. They range from deep golden to medium copper in color. The style may use any variety of hops. Though the hop character is intense it's balanced with complex alcohol flavors, moderate to high fruity esters and medium to high malt character. Hop character should be fresh and lively and should not be harsh in quality. The use of large amounts of hops may cause a degree of appropriate hop haze. Imperial or Double India Pale Ales have medium-high to full body. Diacetyl should not be perceived. The intention of this style of beer is to exhibit the fresh and bright character of hops. Oxidative character and aged character should not be present.
                    [ibuMin] => 65
                    [ibuMax] => 100
                    [abvMin] => 7.5
                    [abvMax] => 10.5
                    [srmMin] => 5
                    [srmMax] => 13
                    [ogMin] => 1.075
                    [fgMin] => 1.012
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:46
                )

        )

    [27] => Array
        (
            [id] => 8f8vqK
            [name] => "Sniff" IPA
            [nameDisplay] => "Sniff" IPA
            [abv] => 6
            [ibu] => 50
            [styleId] => 30
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 17:01:42
            [updateDate] => 2015-11-03 17:01:42
            [style] => Array
                (
                    [id] => 30
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style India Pale Ale
                    [shortName] => American IPA
                    [description] => American-style India pale ales are perceived to have medium-high to intense hop bitterness, flavor and aroma with medium-high alcohol content. The style is further characterized by floral, fruity, citrus-like, piney, resinous, or sulfur-like American-variety hop character. Note that one or more of these American-variety hop characters is the perceived end, but the hop characters may be a result of the skillful use of hops of other national origins. The use of water with high mineral content results in a crisp, dry beer. This pale gold to deep copper-colored ale has a full, flowery hop aroma and may have a strong hop flavor (in addition to the perception of hop bitterness). India pale ales possess medium maltiness which contributes to a medium body. Fruity-ester flavors and aromas are moderate to very strong. Diacetyl can be absent or may be perceived at very low levels. Chill and/or hop haze is allowable at cold temperatures. (English and citrus-like American hops are considered enough of a distinction justifying separate American-style IPA and English-style IPA categories or subcategories. Hops of other origins may be used for bitterness or approximating traditional American or English character. See English-style India Pale Ale
                    [ibuMin] => 50
                    [ibuMax] => 70
                    [abvMin] => 6.3
                    [abvMax] => 7.5
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.06
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:37
                )

        )

    [28] => Array
        (
            [id] => Dj5OOw
            [name] => "SuperDude!" Barrel-Aged Russian Imperial Stout
            [nameDisplay] => "SuperDude!" Barrel-Aged Russian Imperial Stout
            [description] => Dude Abide no More! Aging for six months in a Big Bottom Whiskey Barrel, this dark full-bodied stout absorbed maximum amounts of bourbon character and flavor. Rich and smooth, the “SuperDude!” is our best stout yet.
            [abv] => 10
            [ibu] => 50
            [styleId] => 135
            [isOrganic] => Y
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-05-18 15:36:53
            [updateDate] => 2015-05-18 15:36:53
            [style] => Array
                (
                    [id] => 135
                    [categoryId] => 11
                    [category] => Array
                        (
                            [id] => 11
                            [name] => Hybrid/mixed Beer
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Wood- and Barrel-Aged Strong Beer
                    [shortName] => BBL Aged Strong
                    [description] => Any strong classic style or unique, experimental style of beer can be wood or barrel-aged for a period of time in a wooden barrel or in contact with wood. This beer is aged with the intention of imparting the particularly unique character of the wood and/or what has previously been in the barrel. New wood character can be characterized as a complex blend of vanillin and unique wood character but wood aged is not necessarily synonymous with imparting wood-flavors. Used sherry, rum, bourbon, scotch, port, wine and other barrels are often used, imparting complexity and uniqueness to beer. Ultimately a balance of flavor, aroma and mouthfeel are sought with the marriage of new beer with wood and/or barrel flavors. Primary character of the beer style may or may not be apparent. Sour wood-aged beer of any color is outlined in other categories. Beers in this style may or may not have Brettanomyces character. The brewer must explain the special nature of the beer to allow for accurate judging. Comments could include: type of wood used (new or old, oak or other wood type), type of barrel used (new, port/ whiskey/ wine/ sherry/ other), base beer style or achieved character. Beer entries not accompanied by this information will be at a disadvantage during judging.
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:46:50
                )

        )

    [29] => Array
        (
            [id] => VnoFfW
            [name] => "The Great Boo" Pumpkin Ale
            [nameDisplay] => "The Great Boo" Pumpkin Ale
            [description] => Ale brewed with pumpkin and spices.
            [abv] => 5.3
            [styleId] => 121
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2014-10-24 14:35:49
            [updateDate] => 2014-10-24 14:35:49
            [style] => Array
                (
                    [id] => 121
                    [categoryId] => 11
                    [category] => Array
                        (
                            [id] => 11
                            [name] => Hybrid/mixed Beer
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Pumpkin Beer
                    [shortName] => Pumpkin Beer
                    [description] => Pumpkin beers are any beers using pumpkins (Cucurbito pepo) as an adjunct in either mash, kettle, primary or secondary fermentation, providing obvious (ranging from subtle to intense), yet harmonious, qualities. Pumpkin qualities should not be overpowered by hop character. These may or may not be spiced or flavored with other things. A statement by the brewer explaining the nature of the beer is essential for fair assessment in competitions. If this beer is a classic style with pumpkin, the brewer should also specify the classic style.
                    [ibuMin] => 5
                    [ibuMax] => 70
                    [abvMin] => 2.5
                    [abvMax] => 12
                    [srmMin] => 5
                    [srmMax] => 50
                    [ogMin] => 1.03
                    [fgMin] => 1.006
                    [fgMax] => 1.03
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:44:28
                )

        )

    [30] => Array
        (
            [id] => o9CdUe
            [name] => "The King" Imperial Elvis Peanut Butter Banana Sandwich Brown Ale
            [nameDisplay] => "The King" Imperial Elvis Peanut Butter Banana Sandwich Brown Ale
            [description] => The imperial version of Elvis has twice the peanut butter of the regular elvis and quite a malt bill! Creating a sweet, dense, rich double brown ale with intense peanut butter flavor. This brew will be released once a year during our Annual Elvis Day at the Brewpub celebration in April!
            [abv] => 8.2
            [ibu] => 25
            [availableId] => 2
            [styleId] => 125
            [isOrganic] => Y
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-05-27 14:54:18
            [updateDate] => 2015-05-27 14:54:18
            [available] => Array
                (
                    [id] => 2
                    [name] => Limited
                    [description] => Limited availability.
                )

            [style] => Array
                (
                    [id] => 125
                    [categoryId] => 11
                    [category] => Array
                        (
                            [id] => 11
                            [name] => Hybrid/mixed Beer
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Specialty Beer
                    [shortName] => Specialty
                    [description] => These beers are brewed using unusual fermentable sugars, grains and starches that contribute to alcohol content other than, or in addition to, malted barley. Nuts generally have some degree of fermentables, thus beers brewed with nuts would appropriately be entered in this category. The distinctive characters of these special ingredients should be evident either in the aroma, flavor or overall balance of the beer, but not necessarily in overpowering quantities. For example, maple syrup or potatoes would be considered unusual. Rice, corn, or wheat are not considered unusual. Special ingredients must be listed when competing. A statement by the brewer explaining the special nature of the beer, ingredient(s) and achieved character is essential in order for fair assessment in competitions. If this beer is a classic style with some specialty ingredient(s), the brewer should also specify the classic style. Guidelines for competing: Spiced beers using unusual fermentables should be entered in the experimental category. Fruit beers using unusual fermentables should be entered in the fruit beer category.
                    [ibuMax] => 100
                    [abvMin] => 2.5
                    [abvMax] => 25
                    [srmMin] => 1
                    [srmMax] => 100
                    [ogMin] => 1.03
                    [fgMin] => 1.006
                    [fgMax] => 1.03
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:44:53
                )

        )

    [31] => Array
        (
            [id] => u1hJXS
            [name] => "The Reason" Saison
            [nameDisplay] => "The Reason" Saison
            [abv] => 4.5
            [ibu] => 15
            [styleId] => 72
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 16:58:37
            [updateDate] => 2015-11-03 16:58:37
            [style] => Array
                (
                    [id] => 72
                    [categoryId] => 5
                    [category] => Array
                        (
                            [id] => 5
                            [name] => Belgian And French Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => French & Belgian-Style Saison
                    [shortName] => Saison
                    [description] => Beers in this category are golden to deep amber in color. There may be quite a variety of characters within this style. Generally: They are light to medium in body. Malt aroma is low to medium-low. Esters are medium to high in  aroma, while, complex alcohols, herbs, spices, low Brettanomyces character and even clove and smoke-like phenolics may or may not be evident in the overall balanced beer. Hop aroma and flavor may be at low to medium levels. Malt flavor is low but provides foundation for the overall balance. Hop bitterness is moderate to moderately assertive. Herb and/or spice flavors, including black pepper-like notes, may or may not be evident. Fruitiness from fermentation is generally in character. A balanced small amount of sour or acidic flavors is acceptable when in balance with other components. Earthy, cellar-like, musty aromas are okay. Diacetyl should not be perceived. Chill or slight yeast haze is okay. Often bottle conditioned with some yeast character and high carbonation. French & Belgian-Style Saison may have Brettanomyces characters that are slightly acidity, fruity, horsey, goaty and/or leather-like.
                    [ibuMin] => 20
                    [ibuMax] => 40
                    [abvMin] => 4.5
                    [abvMax] => 8.5
                    [srmMin] => 4
                    [srmMax] => 14
                    [ogMin] => 1.055
                    [fgMin] => 1.004
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:34:55
                )

        )

    [32] => Array
        (
            [id] => 1qDm69
            [name] => "Thick Witted" Kaffir Double Wit
            [nameDisplay] => "Thick Witted" Kaffir Double Wit
            [description] => Senior brewer Sam Barber has created this strong Belgian witbier as one of our four anniversary beers.
            [abv] => 6.7
            [ibu] => 25
            [styleId] => 65
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2014-09-15 19:25:12
            [updateDate] => 2014-11-09 14:29:48
            [style] => Array
                (
                    [id] => 65
                    [categoryId] => 5
                    [category] => Array
                        (
                            [id] => 5
                            [name] => Belgian And French Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Belgian-Style White (or Wit) / Belgian-Style Wheat
                    [shortName] => Witbier
                    [description] => Belgian white ales are very pale in color and are brewed using unmalted wheat and malted barley and are spiced with coriander and orange peel. Coriander and light orange peel aroma should be perceived as such or as an unidentified spiciness. Phenolic spiciness and yeast flavors may be evident at mild levels. These beers are traditionally bottle conditioned and served cloudy. An unfiltered starch and yeast haze should be part of the appearance. The low to medium body should have some degree of creaminess from wheat starch. The style is further characterized by the use of noble-type hops to achieve low hop bitterness and little to no apparent hop flavor. This beer has no diacetyl and a low to medium fruity-ester level. Mild acidity is appropriate.
                    [ibuMin] => 10
                    [ibuMax] => 17
                    [abvMin] => 4.8
                    [abvMax] => 5.2
                    [srmMin] => 2
                    [srmMax] => 4
                    [ogMin] => 1.044
                    [fgMin] => 1.006
                    [fgMax] => 1.01
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:32:30
                )

        )

    [33] => Array
        (
            [id] => dXHJTS
            [name] => "Thunderkissed" Coffee Infused Milk Stout
            [nameDisplay] => "Thunderkissed" Coffee Infused Milk Stout
            [description] => Local Columbus coffee roaster Thunderkiss Coffee provides us with freshly roasted coffee beans which we infuse into our milk stout. The result is an amped-up, extra dimension of roastiness.
            [abv] => 5.3
            [ibu] => 20
            [styleId] => 123
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-07-02 19:36:22
            [updateDate] => 2015-07-02 19:36:22
            [style] => Array
                (
                    [id] => 123
                    [categoryId] => 11
                    [category] => Array
                        (
                            [id] => 11
                            [name] => Hybrid/mixed Beer
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Coffee-Flavored Beer
                    [shortName] => Coffee Beer
                    [description] => Coffee beers use coffee in any of its forms other than or in addition to hops to create a distinct (ranging from subtle to intense) character. Under hopping allows coffee to contribute to the flavor profile while not becoming excessively bitter. If this beer is a classic style with coffee flavor, the brewer should specify the classic style.
                    [ibuMin] => 15
                    [ibuMax] => 40
                    [abvMin] => 2.5
                    [abvMax] => 12
                    [srmMin] => 8
                    [srmMax] => 50
                    [ogMin] => 1.03
                    [fgMin] => 1.006
                    [fgMax] => 1.03
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:44:40
                )

        )

    [34] => Array
        (
            [id] => bw2AS4
            [name] => "Tractor Beam" Oatmeal Stout
            [nameDisplay] => "Tractor Beam" Oatmeal Stout
            [abv] => 5.8
            [ibu] => 30
            [styleId] => 21
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 17:06:57
            [updateDate] => 2015-11-03 17:06:57
            [style] => Array
                (
                    [id] => 21
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Oatmeal Stout
                    [shortName] => Oatmeal Stout
                    [description] => Oatmeal stouts include oatmeal in their grist, resulting in a pleasant, full flavor and a smooth profile that is rich without being grainy. A roasted malt character which is caramel-like and chocolate-like should be evident - smooth and not bitter. Coffee-like roasted barley and roasted malt aromas (chocolate and nut-like) are prominent. Color is dark brown to black. Bitterness is moderate, not high. Hop flavor and aroma are optional but should not overpower the overall balance if present. This is a medium- to full- bodied beer, with minimal fruity esters. Diacetyl should be absent or at extremely low levels. Original gravity range and alcohol levels are indicative of English tradition of oatmeal stout.
                    [ibuMin] => 20
                    [ibuMax] => 40
                    [abvMin] => 3.8
                    [abvMax] => 6
                    [srmMin] => 20
                    [srmMax] => 20
                    [ogMin] => 1.038
                    [fgMin] => 1.008
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:22:53
                )

        )

    [35] => Array
        (
            [id] => kyrjzl
            [name] => "Turbocharger" Double IPA
            [nameDisplay] => "Turbocharger" Double IPA
            [abv] => 8.2
            [ibu] => 70
            [styleId] => 31
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-11-03 17:02:08
            [updateDate] => 2015-11-03 17:02:08
            [style] => Array
                (
                    [id] => 31
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Imperial or Double India Pale Ale
                    [shortName] => Imperial IPA
                    [description] => Imperial or Double India Pale Ales have intense hop bitterness, flavor and aroma. Alcohol content is medium-high to high and notably evident. They range from deep golden to medium copper in color. The style may use any variety of hops. Though the hop character is intense it's balanced with complex alcohol flavors, moderate to high fruity esters and medium to high malt character. Hop character should be fresh and lively and should not be harsh in quality. The use of large amounts of hops may cause a degree of appropriate hop haze. Imperial or Double India Pale Ales have medium-high to full body. Diacetyl should not be perceived. The intention of this style of beer is to exhibit the fresh and bright character of hops. Oxidative character and aged character should not be present.
                    [ibuMin] => 65
                    [ibuMax] => 100
                    [abvMin] => 7.5
                    [abvMax] => 10.5
                    [srmMin] => 5
                    [srmMax] => 13
                    [ogMin] => 1.075
                    [fgMin] => 1.012
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:46
                )

        )

    [36] => Array
        (
            [id] => K83yUU
            [name] => "Whistleblower" Belgian Wit
            [nameDisplay] => "Whistleblower" Belgian Wit
            [description] => Belgian style beer with wheat, barley and oats for a smooth malt character. Additions of elderflower, coriander and orange peel give this traditional wheat beer a spicy character.
            [abv] => 5.2
            [ibu] => 28
            [glasswareId] => 5
            [availableId] => 1
            [styleId] => 65
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-07-27 14:02:47
            [updateDate] => 2015-03-18 18:22:19
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 65
                    [categoryId] => 5
                    [category] => Array
                        (
                            [id] => 5
                            [name] => Belgian And French Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Belgian-Style White (or Wit) / Belgian-Style Wheat
                    [shortName] => Witbier
                    [description] => Belgian white ales are very pale in color and are brewed using unmalted wheat and malted barley and are spiced with coriander and orange peel. Coriander and light orange peel aroma should be perceived as such or as an unidentified spiciness. Phenolic spiciness and yeast flavors may be evident at mild levels. These beers are traditionally bottle conditioned and served cloudy. An unfiltered starch and yeast haze should be part of the appearance. The low to medium body should have some degree of creaminess from wheat starch. The style is further characterized by the use of noble-type hops to achieve low hop bitterness and little to no apparent hop flavor. This beer has no diacetyl and a low to medium fruity-ester level. Mild acidity is appropriate.
                    [ibuMin] => 10
                    [ibuMax] => 17
                    [abvMin] => 4.8
                    [abvMax] => 5.2
                    [srmMin] => 2
                    [srmMax] => 4
                    [ogMin] => 1.044
                    [fgMin] => 1.006
                    [fgMax] => 1.01
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:32:30
                )

        )

    [37] => Array
        (
            [id] => S4DA2h
            [name] => "Wintah" Ale
            [nameDisplay] => "Wintah" Ale
            [description] => Wormtown Brewery's Winter Seasonal is an American Brown Ale. Mahogany Brown in color with malty aroma and hints of toasted brown bread. Medium body highlighting luscious malt flavor and aftertaste of roasty cocoa.

Gold Medal Winner @ GIBF 2010
            [abv] => 6
            [ibu] => 24
            [glasswareId] => 5
            [availableId] => 4
            [styleId] => 37
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-01-03 02:42:36
            [updateDate] => 2014-10-16 16:09:06
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [available] => Array
                (
                    [id] => 4
                    [name] => Seasonal
                    [description] => Available at the same time of year, every year.
                )

            [style] => Array
                (
                    [id] => 37
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Brown Ale
                    [shortName] => American Brown
                    [description] => American brown ales range from deep copper to brown in color. Roasted malt caramel-like and chocolate-like characters should be of medium intensity in both flavor and aroma. American brown ales have evident low to medium hop flavor and aroma, medium to high hop bitterness, and a medium body. Estery and fruity-ester characters should be subdued. Diacetyl should not be perceived. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 25
                    [ibuMax] => 45
                    [abvMin] => 4
                    [abvMax] => 6.4
                    [srmMin] => 15
                    [srmMax] => 26
                    [ogMin] => 1.04
                    [fgMin] => 1.01
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:27:35
                )

        )

    [38] => Array
        (
            [id] => 2toTiw
            [name] => # 100
            [nameDisplay] => # 100
            [description] => Our 100th batch, brewed for the enjoyment of the brewers, but popular demand forced us to release it commercially.
This malty, yet light bodied ale has a massive hop bitterness. Most enjoyable in a comfortable chair in front of a roaring fire.
            [abv] => 10
            [ibu] => 80
            [styleId] => 7
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [servingTemperature] => warm
            [servingTemperatureDisplay] => Warm - (14-16C/57-61F)
            [originalGravity] => 1.094
            [createDate] => 2015-02-19 22:18:53
            [updateDate] => 2015-03-17 16:34:50
            [style] => Array
                (
                    [id] => 7
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Scottish-Style Light Ale
                    [shortName] => Scottish Light
                    [description] => Scottish light ales are light bodied. Little bitterness is perceived, and hop flavor or aroma should not be perceived. Despite its lightness, Scottish light ale will have a degree of malty, caramel-like, soft and chewy character. Yeast characters such as diacetyl (butterscotch) and sulfuriness are acceptable at very low levels. The color will range from golden amber to deep brown Bottled versions of this traditional draft beer may contain higher amounts of carbon dioxide than is typical for mildly carbonated draft versions. Chill haze is acceptable at low temperatures. Though there is little evidence suggesting that traditionally made Scottishstyle light ales exhibited peat smoke character, the current marketplace offers many Scottish-style light ales with peat or smoke character present at low to medium levels. Thus a peaty/smoky character may be evident at low levels (ales with medium or higher smoke character would be considered a smoke flavored beer and considered in another category). Scottish-style light ales may be split into two subcategories: Traditional (no smoke character) and Peated (low level of peat smoke character).
                    [ibuMin] => 9
                    [ibuMax] => 20
                    [abvMin] => 2.8
                    [abvMax] => 3.5
                    [srmMin] => 8
                    [srmMax] => 17
                    [ogMin] => 1.03
                    [fgMin] => 1.006
                    [fgMax] => 1.012
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:19:41
                )

        )

    [39] => Array
        (
            [id] => vX0d37
            [name] => # 500
            [nameDisplay] => # 500
            [description] => When Nøgne Ø decided to make it’s 500thbatch of beer, it was quickly established that the key numbers would be 5 malts, 5 hops, 10% alcohol and 100 IBUs. The result is an incredibly rich and hoppy Imperial IPA. Malty enough to be almost a barley wine, but intensely fruity, mainly because it is dry hopped with generous amounts of Nelson Sauvin hops from New Zealand.
            [abv] => 10
            [styleId] => 31
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2013-10-30 14:29:39
            [updateDate] => 2013-10-30 17:05:04
            [style] => Array
                (
                    [id] => 31
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Imperial or Double India Pale Ale
                    [shortName] => Imperial IPA
                    [description] => Imperial or Double India Pale Ales have intense hop bitterness, flavor and aroma. Alcohol content is medium-high to high and notably evident. They range from deep golden to medium copper in color. The style may use any variety of hops. Though the hop character is intense it's balanced with complex alcohol flavors, moderate to high fruity esters and medium to high malt character. Hop character should be fresh and lively and should not be harsh in quality. The use of large amounts of hops may cause a degree of appropriate hop haze. Imperial or Double India Pale Ales have medium-high to full body. Diacetyl should not be perceived. The intention of this style of beer is to exhibit the fresh and bright character of hops. Oxidative character and aged character should not be present.
                    [ibuMin] => 65
                    [ibuMax] => 100
                    [abvMin] => 7.5
                    [abvMax] => 10.5
                    [srmMin] => 5
                    [srmMax] => 13
                    [ogMin] => 1.075
                    [fgMin] => 1.012
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:46
                )

        )

    [40] => Array
        (
            [id] => BVvaGP
            [name] => #007
            [nameDisplay] => #007
            [abv] => 5.3
            [styleId] => 25
            [isOrganic] => N
            [labels] => Array
                (
                    [icon] => https://s3.amazonaws.com/brewerydbapi/beer/BVvaGP/upload_pPBiJL-icon.png
                    [medium] => https://s3.amazonaws.com/brewerydbapi/beer/BVvaGP/upload_pPBiJL-medium.png
                    [large] => https://s3.amazonaws.com/brewerydbapi/beer/BVvaGP/upload_pPBiJL-large.png
                )

            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-02-11 12:28:07
            [updateDate] => 2015-12-17 22:25:13
            [style] => Array
                (
                    [id] => 25
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Pale Ale
                    [shortName] => American Pale
                    [description] => American pale ales range from deep golden to copper in color. The style is characterized by fruity, floral and citrus-like American-variety hop character producing medium to medium-high hop bitterness, flavor, and aroma. Note that the "traditional" style of this beer has its origins with certain floral, fruity, citrus-like, piney, resinous, or sulfur-like American hop varietals. One or more of these hop characters is the perceived end, but the perceived hop characters may be a result of the skillful use of hops of other national origins. American pale ales have medium body and low to medium maltiness. Low caramel character is allowable. Fruity-ester flavor and aroma should be moderate to strong. Diacetyl should be absent or present at very low levels. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 30
                    [ibuMax] => 42
                    [abvMin] => 4.5
                    [abvMax] => 5.6
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.044
                    [fgMin] => 1.008
                    [fgMax] => 1.014
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:25:18
                )

        )

    [41] => Array
        (
            [id] => YoKSFm
            [name] => #1 American
            [nameDisplay] => #1 American
            [description] => If anything has ever tasted like freedom before, it is F-Town’s signature pale ale, #1 American. The first sip entices you with a slight caramel flavor and is surrounded by notes of fresh citrus. The hints of fresh orange and grapefruit will leave you feeling refreshed.
            [styleId] => 25
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2016-01-04 13:33:07
            [updateDate] => 2016-01-04 13:33:07
            [style] => Array
                (
                    [id] => 25
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style Pale Ale
                    [shortName] => American Pale
                    [description] => American pale ales range from deep golden to copper in color. The style is characterized by fruity, floral and citrus-like American-variety hop character producing medium to medium-high hop bitterness, flavor, and aroma. Note that the "traditional" style of this beer has its origins with certain floral, fruity, citrus-like, piney, resinous, or sulfur-like American hop varietals. One or more of these hop characters is the perceived end, but the perceived hop characters may be a result of the skillful use of hops of other national origins. American pale ales have medium body and low to medium maltiness. Low caramel character is allowable. Fruity-ester flavor and aroma should be moderate to strong. Diacetyl should be absent or present at very low levels. Chill haze is allowable at cold temperatures.
                    [ibuMin] => 30
                    [ibuMax] => 42
                    [abvMin] => 4.5
                    [abvMax] => 5.6
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.044
                    [fgMin] => 1.008
                    [fgMax] => 1.014
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:25:18
                )

        )

    [42] => Array
        (
            [id] => WfTRD1
            [name] => #1 Brown Brett Braggot
            [nameDisplay] => #1 Brown Brett Braggot
            [description] => This beer started its life as a brown ale that just wanted to be a bit more. Our farmer Rally, who picks up spent grains also happens to have a pretty thriving bee business. He transports his hives from state to state pollinating large crops for farms as far south as Georgia peach orchards and up north to Maine for Blueberry fields. Having just returned from a blueberry pollination in Maine and looking to sell off some of his honey we jumped on close to 200 lbs of this liquid gold and added it to the brown ale during secondary fermentation. Also added to the Disco funk tank was a blend of yeast, one a Belgian Saison Yeast and the other, our buddy Brettanomyces (aka Brett). This wild yeast strain adds that slight Belgian Funk to our tank and get’s the disco party started.
            [abv] => 6
            [ibu] => 18
            [styleId] => 147
            [isOrganic] => N
            [labels] => Array
                (
                    [icon] => https://s3.amazonaws.com/brewerydbapi/beer/WfTRD1/upload_pvShMp-icon.png
                    [medium] => https://s3.amazonaws.com/brewerydbapi/beer/WfTRD1/upload_pvShMp-medium.png
                    [large] => https://s3.amazonaws.com/brewerydbapi/beer/WfTRD1/upload_pvShMp-large.png
                )

            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-03-29 15:12:57
            [updateDate] => 2015-12-17 23:07:31
            [style] => Array
                (
                    [id] => 147
                    [categoryId] => 12
                    [category] => Array
                        (
                            [id] => 12
                            [name] => Mead, Cider, & Perry
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Braggot
                    [shortName] => Braggot
                    [description] => A harmonious blend of mead and beer, with the distinctive characteristics of both. A wide range of results are possible, depending on the base style of beer, variety of honey and overall sweetness and strength. Beer flavors tend to somewhat mask typical honey flavors found in other meads.
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:48:30
                )

        )

    [43] => Array
        (
            [id] => QR1aJr
            [name] => #1 Fan
            [nameDisplay] => #1 Fan
            [description] => 100% orange blossom honey.
            [abv] => 6.8
            [ibu] => 30
            [availableId] => 2
            [styleId] => 114
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-03-06 21:33:38
            [updateDate] => 2015-03-06 21:33:38
            [available] => Array
                (
                    [id] => 2
                    [name] => Limited
                    [description] => Limited availability.
                )

            [style] => Array
                (
                    [id] => 114
                    [categoryId] => 11
                    [category] => Array
                        (
                            [id] => 11
                            [name] => Hybrid/mixed Beer
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => Fruit Wheat Ale or Lager with or without Yeast
                    [shortName] => Fruit Wheat Ale
                    [description] => This beer can be made using either ale or lager yeast. It can be brewed with 30 to 75 percent malted wheat. Fruit or fruit extracts contribute flavor and/or aroma. Perceived fruit qualities should be authentic and replicate true fruit complexity as much as possible. Color should reflect a degree of fruit's color. Hop rates may be low to medium. Hop characters may be light to moderate in bitterness, flavor and aroma. Fruity-estery aroma and flavor from yeast can be typical but at low levels; however, phenolic, clovelike characteristics should not be perceived. Body should be light to medium in character. Diacetyl should not be perceived. When this style is served with yeast the character should portray a full yeasty mouthfeel and appear hazy to very cloudy. Chill haze is also acceptable. Yeast flavor and aroma should be low to medium but not overpowering the balance and character of malt and hops. Brewer may indicate on the bottle whether the yeast should be intentionally roused or if they prefer that the entry be poured as quietly as possible.
                    [ibuMin] => 10
                    [ibuMax] => 35
                    [abvMin] => 3.8
                    [abvMax] => 5
                    [srmMin] => 2
                    [srmMax] => 10
                    [ogMin] => 1.036
                    [fgMin] => 1.004
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:43:55
                )

        )

    [44] => Array
        (
            [id] => xFM8w5
            [name] => #10 Hefewiezen
            [nameDisplay] => #10 Hefewiezen
            [description] => Northern Pacific Locomotive  #10 was a coal fired tender that worked in the rail yards in Brainerd for decades, switching cars, hauling coal for the power plant, and other duties. After being retired, it stood as a fixture at Brainerd’s Lum Park for years during the 1980’s. It’s the locomotive featured in the picture on our website. By a remarkable coincidence, our hefewiezen ale is the 10th beer that we’ve brewed in our lineup. The German-style wheat beer yeast suspended in the beer adds hints of clove and banana, while the white malted wheat adds a grainy sweetness. Crisp, refreshing, with a dense, white head and light body make this a perfect summer beer.
            [abv] => 5.1
            [ibu] => 11
            [glasswareId] => 5
            [srmId] => 4
            [availableId] => 4
            [styleId] => 48
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [servingTemperature] => cold
            [servingTemperatureDisplay] => Cold - (4-7C/39-45F)
            [originalGravity] => 1.052
            [createDate] => 2016-06-30 14:01:43
            [updateDate] => 2016-07-19 15:19:54
            [glass] => Array
                (
                    [id] => 5
                    [name] => Pint
                    [createDate] => 2012-01-03 02:41:33
                )

            [srm] => Array
                (
                    [id] => 4
                    [name] => 4
                    [hex] => FFBF42
                )

            [available] => Array
                (
                    [id] => 4
                    [name] => Seasonal
                    [description] => Available at the same time of year, every year.
                )

            [style] => Array
                (
                    [id] => 48
                    [categoryId] => 4
                    [category] => Array
                        (
                            [id] => 4
                            [name] => German Origin Ales
                            [createDate] => 2012-03-21 20:06:46
                        )

                    [name] => South German-Style Hefeweizen / Hefeweissbier
                    [shortName] => Hefeweizen
                    [description] => The aroma and flavor of a Weissbier with yeast is decidedly fruity and phenolic. The phenolic characteristics are often described as clove-, nutmeg-like, mildly smoke-like or even vanilla-like. Banana-like esters should be present at low to medium-high levels. These beers are made with at least 50 percent malted wheat, and hop rates are quite low. Hop flavor and aroma are absent or present at very low levels. Weissbier is well attenuated and very highly carbonated and a medium to full bodied beer. The color is very pale to pale amber. Because yeast is present, the beer will have yeast flavor and a characteristically fuller mouthfeel and may be appropriately very cloudy. No diacetyl should be perceived.
                    [ibuMin] => 10
                    [ibuMax] => 15
                    [abvMin] => 4.9
                    [abvMax] => 5.5
                    [srmMin] => 3
                    [srmMax] => 9
                    [ogMin] => 1.047
                    [fgMin] => 1.008
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:29:27
                )

        )

    [45] => Array
        (
            [id] => EliWWJ
            [name] => #15
            [nameDisplay] => #15
            [description] => White IPA w/ Orange Peel, Coriander, Peaches, & Apricot.
            [abv] => 6.7
            [styleId] => 30
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2016-05-02 15:09:45
            [updateDate] => 2016-05-02 15:09:45
            [style] => Array
                (
                    [id] => 30
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => American-Style India Pale Ale
                    [shortName] => American IPA
                    [description] => American-style India pale ales are perceived to have medium-high to intense hop bitterness, flavor and aroma with medium-high alcohol content. The style is further characterized by floral, fruity, citrus-like, piney, resinous, or sulfur-like American-variety hop character. Note that one or more of these American-variety hop characters is the perceived end, but the hop characters may be a result of the skillful use of hops of other national origins. The use of water with high mineral content results in a crisp, dry beer. This pale gold to deep copper-colored ale has a full, flowery hop aroma and may have a strong hop flavor (in addition to the perception of hop bitterness). India pale ales possess medium maltiness which contributes to a medium body. Fruity-ester flavors and aromas are moderate to very strong. Diacetyl can be absent or may be perceived at very low levels. Chill and/or hop haze is allowable at cold temperatures. (English and citrus-like American hops are considered enough of a distinction justifying separate American-style IPA and English-style IPA categories or subcategories. Hops of other origins may be used for bitterness or approximating traditional American or English character. See English-style India Pale Ale
                    [ibuMin] => 50
                    [ibuMax] => 70
                    [abvMin] => 6.3
                    [abvMax] => 7.5
                    [srmMin] => 6
                    [srmMax] => 14
                    [ogMin] => 1.06
                    [fgMin] => 1.012
                    [fgMax] => 1.018
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:26:37
                )

        )

    [46] => Array
        (
            [id] => uLkd3a
            [name] => #2 Brett Golden Sour
            [nameDisplay] => #2 Brett Golden Sour
            [description] => This beer had a long weekend in our brew kettle allowing beer bugs (Pediococcus and Latcobacillus) to get down get down and do their sour thang. While yeast strains eat sugar and produce alcohol beer bugs eat sugar and produce acids. This gives sour beers their puckering power. After letting the bugs play in the sweet wort pool we boil the beer and add a touch of earthy hops. Disco Pig #2 Brett Golden Sour is 100% Brett fermented to replicate as closely as possible what a traditional Belgian wild fermented sour beer should be!
            [abv] => 6.5
            [ibu] => 9
            [styleId] => 36
            [isOrganic] => N
            [labels] => Array
                (
                    [icon] => https://s3.amazonaws.com/brewerydbapi/beer/uLkd3a/upload_dag3lM-icon.png
                    [medium] => https://s3.amazonaws.com/brewerydbapi/beer/uLkd3a/upload_dag3lM-medium.png
                    [large] => https://s3.amazonaws.com/brewerydbapi/beer/uLkd3a/upload_dag3lM-large.png
                )

            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-03-29 15:10:51
            [updateDate] => 2015-12-18 00:22:07
            [style] => Array
                (
                    [id] => 36
                    [categoryId] => 3
                    [category] => Array
                        (
                            [id] => 3
                            [name] => North American Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Golden or Blonde Ale
                    [shortName] => Blonde
                    [description] => Golden or Blonde ales are straw to golden blonde in color. They have a crisp, dry palate, light to medium body, and light malt sweetness. Low to medium hop aroma may be present but does not dominate. Bitterness is low to medium. Fruity esters may be perceived but do not predominate. Diacetyl should not be perceived. Chill haze should be absent.
                    [ibuMin] => 15
                    [ibuMax] => 25
                    [abvMin] => 4
                    [abvMax] => 5
                    [srmMin] => 3
                    [srmMax] => 7
                    [ogMin] => 1.045
                    [fgMin] => 1.008
                    [fgMax] => 1.016
                    [createDate] => 2012-03-21 20:06:46
                    [updateDate] => 2015-04-07 15:27:26
                )

        )

    [47] => Array
        (
            [id] => Z7tz1C
            [name] => #2 Strong Ale
            [nameDisplay] => #2 Strong Ale
            [description] => Peter entered his home brewed version of this OBBC favorite in the US Beer Tasting Championships in 2010 and came home a winner. It is as delicious as it is unique, a dark amber color with an enticing aroma of fruit and cloves give way to a deep, sweet flavor and smooth finish. We use dark Belgian candy sugar to kick up the alcohol and balance out the assertive Belgian yeast flavors.
            [abv] => 10
            [ibu] => 24
            [availableId] => 1
            [styleId] => 14
            [isOrganic] => Y
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2015-06-01 14:29:55
            [updateDate] => 2015-06-01 15:46:14
            [available] => Array
                (
                    [id] => 1
                    [name] => Year Round
                    [description] => Available year round as a staple beer.
                )

            [style] => Array
                (
                    [id] => 14
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Strong Ale
                    [shortName] => Strong Ale
                    [description] => Light amber to mid-range brown in color, strong ales are medium to full bodied with a malty sweetness and may have low levels of roast malt character. Hop aroma should be minimal and flavor can vary from none to medium in character intensity. Fruity-ester flavors and aromas can contribute to the character of this ale. Bitterness should be minimal but evident and balanced with malt and/or caramel-like sweetness. Alcohol types can be varied and complex. A rich, often sweet and complex estery character may be evident. Very low levels of diacetyl are acceptable. Chill haze is acceptable at low temperatures. (This style may often be split into two categories, strong and very strong.)
                    [ibuMin] => 30
                    [ibuMax] => 65
                    [abvMin] => 7
                    [abvMax] => 11
                    [srmMin] => 8
                    [srmMax] => 21
                    [ogMin] => 1.06
                    [fgMin] => 1.014
                    [fgMax] => 1.04
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:21:05
                )

        )

    [48] => Array
        (
            [id] => EVWmiT
            [name] => #34 Oatmeal Stout
            [nameDisplay] => #34 Oatmeal Stout
            [abv] => 5.2
            [styleId] => 21
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2014-10-01 23:56:44
            [updateDate] => 2014-10-02 14:47:30
            [style] => Array
                (
                    [id] => 21
                    [categoryId] => 1
                    [category] => Array
                        (
                            [id] => 1
                            [name] => British Origin Ales
                            [createDate] => 2012-03-21 20:06:45
                        )

                    [name] => Oatmeal Stout
                    [shortName] => Oatmeal Stout
                    [description] => Oatmeal stouts include oatmeal in their grist, resulting in a pleasant, full flavor and a smooth profile that is rich without being grainy. A roasted malt character which is caramel-like and chocolate-like should be evident - smooth and not bitter. Coffee-like roasted barley and roasted malt aromas (chocolate and nut-like) are prominent. Color is dark brown to black. Bitterness is moderate, not high. Hop flavor and aroma are optional but should not overpower the overall balance if present. This is a medium- to full- bodied beer, with minimal fruity esters. Diacetyl should be absent or at extremely low levels. Original gravity range and alcohol levels are indicative of English tradition of oatmeal stout.
                    [ibuMin] => 20
                    [ibuMax] => 40
                    [abvMin] => 3.8
                    [abvMax] => 6
                    [srmMin] => 20
                    [srmMax] => 20
                    [ogMin] => 1.038
                    [fgMin] => 1.008
                    [fgMax] => 1.02
                    [createDate] => 2012-03-21 20:06:45
                    [updateDate] => 2015-04-07 15:22:53
                )

        )

    [49] => Array
        (
            [id] => PvaOWz
            [name] => #40 Golden Lager
            [nameDisplay] => #40 Golden Lager
            [isOrganic] => N
            [status] => verified
            [statusDisplay] => Verified
            [createDate] => 2012-01-03 02:42:36
            [updateDate] => 2012-03-22 13:04:49
        )

)

Open in new window

0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41820674
If I read your data correctly your $results is an array of arrays the latter having around 50 entries.
Do you need to insert ALL the values from all the arrays into the database?

If so you are going to need two loops
foreach($results as $result) {
   foreach($result as $row) {
	$sql = "
		INSERT INTO masterbrewlist (
			BreweryDbId, 
			BeerName, 
			Description, 
			ABV) 
		VALUES (
		'{$row['id']}', 
		'{$row['name']}', 
		'{$row['description']}', 
		'{$row['abv']}')";
   }
}

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41820693
Yes I need all 50 and then it has to go to the next page which is another 50 , and etc until I get to the end.
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820696
I think this is what's needed. The strings should probably be escaped too.

foreach($results['data'] as $result){
  $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV)
 VALUES (
'{$result['id']}',
'".mysqli_real_escape_string($result['name'])."',
'".mysqli_real_escape_string($result['description'])."',
'".mysqli_real_escape_string($result['abv'])."');
}

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41820700
ok so the foreach($results ['data'] as $result){   worked however it only copied to my database the BrewerDBID and Beer name. Description and ABV it didn't.
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820701
Ok, two loops may be required. I have to go out, so hopefully you both can finish nutting it out... good luck!
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41820734
Just checking if this line is only fetching page 1?
$params=array('/beers','p' => 1,)

Open in new window

If so then the foreach($results['data'] as $result) seems to be the right move - and you then need to repeat the whole process for all pages.
Can you do an
echo $sql . "<br>";

Open in new window

After you create the $sql query so we can see what the query actually looks like.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820739
<?php
include ("Brewerydb.php");
 echo "<br> Step 2 GET beers from Brewery DB";
 
 
$apikey = 'APIKey';

$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 
$params=array('/beers','p' => 1,);
$results = array();
try {
    
// The first argument to request() is the endpoint you want to call
// 'brewery/BrvKTz', 'beers', etc.
// The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
} catch (Exception $e) {
    $results = array('error' => $e->getMessage());
}

var_dump($results);


$servername = "localhost";
$username = "root";
$password = "Password";
$dbname = "MyDb";

// Create MYSQL connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

foreach($results ['data'] as $result){
	foreach($result as $row) {
	
//***--Uncomment below to export to a text file or .csv 
//file_put_contents('/logfile.txt', print_r($result,true)."\n",FILE_APPEND);
	
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('{$result['id']}','{$result['name']}','{$result['description']}','{$result['abv']}')";
}
}

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>

Open in new window

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Ray Zuchowski
ID: 41820742
Just posted my current code. Still getting errors for description and abv.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820747
$params=array('/beers','p' => 1,)

Open in new window


Yes that's correct that means page 1 , I can take that params out .
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41820753
Then you need to remove the double loop - take the foreach at line 38 out - I did not see your var_dump of $results and assumed all pages where represented in that. Terry's initial suggestion was good.
Just do
foreach($results ['data'] as $result){
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('{$result['id']}','{$result['name']}','{$result['description']}','{$result['abv']}')";
	if ($conn->query($sql) === TRUE) {
		echo "New record created successfully";
	} else {
		echo "Error: " . $sql . "<br>" . $conn->error;
	}
}

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41820831
@Julian Here is my current code. Doing what you suggested worked but im getting errors still.

 <?php
include ("Brewerydb.php");
 echo "<br> Step 2 GET beers from Brewery DB";
 
 
$apikey = '';

$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 
$params=array('/beers','p' => 1,);
$results = array();
try {
    
// The first argument to request() is the endpoint you want to call
// 'brewery/BrvKTz', 'beers', etc.
// The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
} catch (Exception $e) {
    $results = array('error' => $e->getMessage());
}

var_dump($results);


$servername = "localhost";
$username = "root";
$password = "";
$dbname = "";

// Create MYSQL connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 


foreach($results ['data'] as $result){
	//***--Uncomment below to export to a text file or .csv 
    //file_put_contents('/logfile.txt', print_r($result,true)."\n",FILE_APPEND);
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('{$result['id']}','{$result['name']}','{$result['description']}','{$result['abv']}')";
if ($conn->query($sql) === TRUE) {
		echo "New record created successfully";
	} else {
		echo "Error: " . $sql . "<br>" . $conn->error;
	}
}
$conn->close();
?>

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41820833
Here are the errors.



( ! ) Notice: Undefined index: abv in C:\wamp64\www\GetBeers2.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0000 243936 {main}( ) ...\GetBeers2.php:0
 New record created successfullyNew record created successfullyNew record created successfullyNew record created successfully


( ! ) Notice: Undefined index: abv in C:\wamp64\www\GetBeers2.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0000 243936 {main}( ) ...\GetBeers2.php:0
 New record created successfully


( ! ) Notice: Undefined index: description in C:\wamp64\www\GetBeers2.php on line 41


Call Stack


#

Time

Memory

Function

Location

1 0.0000 243936 {main}( ) ...\GetBeers2.php:0
0
 

Author Comment

by:Ray Zuchowski
ID: 41820841
Im wondering if its throwing an error cause on some of these entries ABV or description doesn't exist. Can we add something in there that if the field doesn't exist ignore ?
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820844
Another useful thing to output to the log would simply be the SQL you've built. Try using this to log the query, and let us know what appears in the log for the data that fails:

foreach($results ['data'] as $result){
	//***--Uncomment below to export to a text file or .csv 
    //file_put_contents('/logfile.txt', print_r($result,true)."\n",FILE_APPEND);
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('{$result['id']}','{$result['name']}','{$result['description']}','{$result['abv']}')";
    file_put_contents('/logfile.txt', "SQL: $sql\n",FILE_APPEND);

Open in new window

0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820846
I notice that you're not using the mysqli_real_escape_string call I suggested. Without that, when your data contains single quotes, they will break the query and cause an error.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820851
Here is what it dumped. In txt. I attached a csv file that is easier to read I think. NVM in text editor its easier to read.


SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('cBLTUw','"18" Imperial IPA 2','Hop Heads this one's for you!  Checking in with 143 IBU's this ale punches you in the mouth with extreme bitterness then rounds out with toffee flavors and finishes with a citrus aroma.  Made with tons of US 2 Row Barley to get this to ABV 11.1%.','11.1')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('ZsQEJt','"633" American Pale Ale','Our first beer has been aptly named "633" after the Regions telephone exchange for starters.  "If I could call a beer home, this would be the one." ~ Win

It is a mildly hoppy pale ale using a 2 row, vienna, and munich malts for body,color, and head retention. It is hopped with American west coast hops later in the boil giving it a nice citrus hop flavor and very mild aroma. Slight addition of a roasted caramel malt gives "633" it's signature 'sunset over the harbor glow'.','6.33')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('tmEthz','"Admiral" Stache','Milwaukee Brewing Co’s take on a classic European style. Baltic Porters are the stronger lager fermented cousin of the classic London Porter. The higher strength and cold fermentation help to create a smooth, less fruity porter, rich in roasted malt flavors and aromas. The “Admiral” Stache has a deep brown hue with a light caramel head. Toffee and milk chocolate dominate the flavor with subtle hints of dried fruit. One month of aging in Bourbon Barrels imparted a layer of vanilla and oak.

We first developed this beer in 2007. Our first attempted batch of beer at the 2nd street location was a Baltic Porter. What we ended up with became known as “Shake Down Nut Brown”. You can guess what went wrong from there… But, so many things right! Every year that has gone by, the beer has gotten a little bit stronger, in flavor and alcohol.

We use a black malt for the dark rich color and an extra special malt for the dried fruit flavors. Baltic Porters are fermented cold with a lager yeast. That long slow maturation creates a smooth flavor profile. The anticipation of the bourbon barrel aging it the most exciting part of this brew process. We want that oak character with hints of bourbon, we use 3rd run barrels for this result. Each batch has been slightly different from the last.','7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('b7SfHG','"Ah Me Joy" Porter','A robust porter style ale with a twist. This beer has moderate roastiness with a bitter finish, complemented by the sweetness of almond and coconut, which may remind you of a certain candy. Sit back with a pint and you'll say "ah, me joy!"','5.4')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('zcJMId','"Alternating Currant" Sour','Black Currant Kettle Sour.','4.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('UM8GL6','"B" Street Pineapple Blonde','"B" Street Pineapple Blonde is the lightest beer we have on tap.  Our Pineapple Blonde is a great choice for those just being introduced to craft beer.  For those more familiar with ales, our Blonde is a full-bodied ale with a subtle savory pineapple flavor.','4.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('NIaY9C','"B.B. Rodriguez" Double Brown','Caramel. Walnut. Toast. Luxury.','8.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('PBEXhV','"Bison Eye Rye" Pale Ale | 2 of 4 Part Pale Ale Series','The second in the rotating 4-part series of pale ales explores the adventurous boundaries of balancing various hops and unique malts. This particular brew was crafted with a healthy dose of toasted rye malt and a bodacious amount of New Zealand hops. Tropical aromas of melon and pineapple are balanced with a touch of sweet honey and a refreshing snap due to the mix of bittering hops and rye. Unfiltered, adventurous and crushable.','5.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('wRmmdv','"California Crude" Black IPA','Black ale that is aggressively hopped to balance the malt character. This beer is rich and robust with the additions of black malt for a creamy finish.','7.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('EPYNpW','"C’est Noir" Imperial Stout','10.8% ABV 70 IBU’s A rich and creamy stout with loads of roasted barley and roasted oats infused with 70 IBU’s of hop bitterness to balance this really big beer. (SAY NOIR)','10.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('AXmvOd','"Dust Up" Cloudy Pale Ale | 1 of 4 Part Pale Ale Series','The Pale Ale series will feature 4 distinct variations within the Pale Ale category. "Dust Up" Cloudy Pale Ale, the first of the series, showcases caramelized wheat, an abundant amount of earthy forest hops and finishes crisp and snappy. Unfiltered, untamed, yet friendly to consume.','5.4')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('c5pZg5','"EVL1" Imperial Red Ale','10.4% ABV 64 IBU’s Born from a Robust Porter recipe, it shows it origins with coffee and roasted malt notes. A kicked-up red ale with a deep copper red color and a rich, malty sweet flavor.','10.4')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('xBKAka','"Galactic Wrath" IPA','In August 2012, for the First Year Anniversary at our Tap Room and Restaurant, we decided to take two of our favorite Dust Bowl beers…Galaxy Pale Ale and Son of Wrath Double IPA…and formulate a new IPA recipe using elements from both beers. The result was a delicious, bold IPA with the fruity, citrus character and malt backbone of Son of Wrath, as well as the tropical aroma and easy drinkability of Galaxy Pale. It was so popular with our fans, we decided to brew more.','7.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Hr5A0t','"God Country" Kolsch','Good, dense head retention is desirable. Light pearapple-Riesling wine-like fruitiness may be apparent, but is not necessary for this style. Caramel character should not be evident. The body is light to medium-light. This beer has low hop flavor and aroma with medium bitterness. Wheat can be used in brewing this beer. Ale yeast is used for fermentation, though lager yeast is sometimes used in the bottle or final cold conditioning process. Fruity esters should be minimally perceived, if at all. Chill haze should be absent.','5.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('UjFyXJ','"Hey Victor" Smoked Porter','Rooted in Western pop culture, our porter is named for the film, Smoke Signals, and is also related to Sherman Alexie’s story, “This is What it Means to Say, ‘Phoenix, Arizona.’”

Our smoked porter is very approachable; it’s not overly smoky and its blend of malts (Maris Otter, English Brown and chocolate) and hops (East Kent Golding, & Fuggle) will remind you of hikes, s’mores and cool, dusky campfires in the Snowies. Take a growler to the mountains and enjoy its rich color and flavor.','5.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('5UcMBc','"Ignition" IPA','This medium amber beer is infused with a blend of 2-row malted barley and caramel malts. Its balance acquired by using a combination of Pacific Northwest hops for bitterness and aroma.','6.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('mrVjY4','"Jemez Field Notes" Golden Lager','This straw-blond lager is an easy going brew created to help celebrate the oncoming warm summer months. Luke chose a variety of pilsner malts, to convey delightful bready notes, an even mouthfeel and a clean, refreshing finish. Jemez Field Notes pairs well with exploring the outdoors and getting dirty in the field.','4.9')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('54rSgo','"Jemmy Dean" Breakfast Stout','The stout style lends itself well to pairing with coffee.  Our Jemmy stout uses over eight different malts and has a complexity that is complemented by our special cold-pressed Java Vino blend added into the serving tank - yielding our "Jemmy Dean" breakfast stout.','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('JsKjkk','"Mauvaises Choses"','…meaning “Very Bad Things” in French…

As the name suggests this beer is naughty. She creeps up on you and packs a punch, but the best part about her…she never talks back 

A Belgian Golden Ale brewed with California Golden raisins and Canadian Maple Syrup. Trappist yeast creates a strong phenolic aroma reminiscent of passion fruit, plums, and mangos. French and Czech hops add a complex flavor, while taking care not to obstruct the delicate phenols of the Belgian yeast.

Drink up, but be careful, she’s a feisty one!','7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('b7WWL6','"Mike Saw a Sasquatch" Session Ale','The true Summer Ale of Central Oregon! A Golden Ale, light and smooth. You can taste the craftsmanship in this easy drinking ale with a smooth blend of Cascade and Sterling hops and finished with a touch of Honey malt to balance it out. This is a great introduction if you are new to the world of Craft Brewing.  For established craft enthusiasts, 10 Barrel Summer Ale is a good reprieve from overly hopped and overly malty alternatives.','4.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('HXmS9k','"My" Bock','Amber, malty and not too heavy, all around favorite even for the drinkers of the yellow fizzy stuff','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('giqbO2','"Not Just Some" Oatmeal Stout','Made with two-row pale malt, dark chocolate malt, black malt, and flaked oats - this rich stout is brewed with twelve additions of Fuggle hops.  Originally Just Some Oatmeal Stout, the name was changed by popular demand as this truly is unlike any ordinary stout!','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('HhyVO1','"Pinch" Pilsner','','4.9')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('HZ9xM2','"Ray Brown" Porter','Now that the weather's turned a tad darker, your beer should, too. Get cozy with this ebony beauty, a brown porter that starts with notes of milky light chocolate and vanilla bean before morphing into a winter wonderland of mild coffee and hazelnuts. It's dark, tempting, and delicious, just the way longtime loyal customer Ray Brown likes it.','5.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('ETaM11','"Roux 40" Red IPA','','6.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Gb2aAs','"Small Batch" Hazelwood Farmhouse IPA','','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('TAtY2B','"Sneaky Devil" Double IPA','A light golden double-IPA with plenty of body and malt character to match the aggressive hoppiness. Blends of Columbus and Centennial hops round out the aroma. Don’t let the light color fool you. This beer packs a punch.','7.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('8f8vqK','"Sniff" IPA','','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Dj5OOw','"SuperDude!" Barrel-Aged Russian Imperial Stout','Dude Abide no More! Aging for six months in a Big Bottom Whiskey Barrel, this dark full-bodied stout absorbed maximum amounts of bourbon character and flavor. Rich and smooth, the “SuperDude!” is our best stout yet.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('VnoFfW','"The Great Boo" Pumpkin Ale','Ale brewed with pumpkin and spices.','5.3')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('o9CdUe','"The King" Imperial Elvis Peanut Butter Banana Sandwich Brown Ale','The imperial version of Elvis has twice the peanut butter of the regular elvis and quite a malt bill! Creating a sweet, dense, rich double brown ale with intense peanut butter flavor. This brew will be released once a year during our Annual Elvis Day at the Brewpub celebration in April!','8.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('u1hJXS','"The Reason" Saison','','4.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('1qDm69','"Thick Witted" Kaffir Double Wit','Senior brewer Sam Barber has created this strong Belgian witbier as one of our four anniversary beers.','6.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('dXHJTS','"Thunderkissed" Coffee Infused Milk Stout','Local Columbus coffee roaster Thunderkiss Coffee provides us with freshly roasted coffee beans which we infuse into our milk stout. The result is an amped-up, extra dimension of roastiness.','5.3')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('bw2AS4','"Tractor Beam" Oatmeal Stout','','5.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('kyrjzl','"Turbocharger" Double IPA','','8.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('K83yUU','"Whistleblower" Belgian Wit','Belgian style beer with wheat, barley and oats for a smooth malt character. Additions of elderflower, coriander and orange peel give this traditional wheat beer a spicy character.','5.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('S4DA2h','"Wintah" Ale','Wormtown Brewery's Winter Seasonal is an American Brown Ale. Mahogany Brown in color with malty aroma and hints of toasted brown bread. Medium body highlighting luscious malt flavor and aftertaste of roasty cocoa.

Gold Medal Winner @ GIBF 2010','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('2toTiw','# 100','Our 100th batch, brewed for the enjoyment of the brewers, but popular demand forced us to release it commercially.
This malty, yet light bodied ale has a massive hop bitterness. Most enjoyable in a comfortable chair in front of a roaring fire.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('vX0d37','# 500','When Nøgne Ø decided to make it’s 500thbatch of beer, it was quickly established that the key numbers would be 5 malts, 5 hops, 10% alcohol and 100 IBUs. The result is an incredibly rich and hoppy Imperial IPA. Malty enough to be almost a barley wine, but intensely fruity, mainly because it is dry hopped with generous amounts of Nelson Sauvin hops from New Zealand.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('BVvaGP','#007','','5.3')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('YoKSFm','#1 American','If anything has ever tasted like freedom before, it is F-Town’s signature pale ale, #1 American. The first sip entices you with a slight caramel flavor and is surrounded by notes of fresh citrus. The hints of fresh orange and grapefruit will leave you feeling refreshed.','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('WfTRD1','#1 Brown Brett Braggot','This beer started its life as a brown ale that just wanted to be a bit more. Our farmer Rally, who picks up spent grains also happens to have a pretty thriving bee business. He transports his hives from state to state pollinating large crops for farms as far south as Georgia peach orchards and up north to Maine for Blueberry fields. Having just returned from a blueberry pollination in Maine and looking to sell off some of his honey we jumped on close to 200 lbs of this liquid gold and added it to the brown ale during secondary fermentation. Also added to the Disco funk tank was a blend of yeast, one a Belgian Saison Yeast and the other, our buddy Brettanomyces (aka Brett). This wild yeast strain adds that slight Belgian Funk to our tank and get’s the disco party started.','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('QR1aJr','#1 Fan','100% orange blossom honey.','6.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('xFM8w5','#10 Hefewiezen','Northern Pacific Locomotive  #10 was a coal fired tender that worked in the rail yards in Brainerd for decades, switching cars, hauling coal for the power plant, and other duties. After being retired, it stood as a fixture at Brainerd’s Lum Park for years during the 1980’s. It’s the locomotive featured in the picture on our website. By a remarkable coincidence, our hefewiezen ale is the 10th beer that we’ve brewed in our lineup. The German-style wheat beer yeast suspended in the beer adds hints of clove and banana, while the white malted wheat adds a grainy sweetness. Crisp, refreshing, with a dense, white head and light body make this a perfect summer beer.','5.1')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('EliWWJ','#15','White IPA w/ Orange Peel, Coriander, Peaches, & Apricot.','6.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('uLkd3a','#2 Brett Golden Sour','This beer had a long weekend in our brew kettle allowing beer bugs (Pediococcus and Latcobacillus) to get down get down and do their sour thang. While yeast strains eat sugar and produce alcohol beer bugs eat sugar and produce acids. This gives sour beers their puckering power. After letting the bugs play in the sweet wort pool we boil the beer and add a touch of earthy hops. Disco Pig #2 Brett Golden Sour is 100% Brett fermented to replicate as closely as possible what a traditional Belgian wild fermented sour beer should be!','6.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Z7tz1C','#2 Strong Ale','Peter entered his home brewed version of this OBBC favorite in the US Beer Tasting Championships in 2010 and came home a winner. It is as delicious as it is unique, a dark amber color with an enticing aroma of fruit and cloves give way to a deep, sweet flavor and smooth finish. We use dark Belgian candy sugar to kick up the alcohol and balance out the assertive Belgian yeast flavors.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('EVWmiT','#34 Oatmeal Stout','','5.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('PvaOWz','#40 Golden Lager','','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('cBLTUw','"18" Imperial IPA 2','Hop Heads this one's for you!  Checking in with 143 IBU's this ale punches you in the mouth with extreme bitterness then rounds out with toffee flavors and finishes with a citrus aroma.  Made with tons of US 2 Row Barley to get this to ABV 11.1%.','11.1')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('ZsQEJt','"633" American Pale Ale','Our first beer has been aptly named "633" after the Regions telephone exchange for starters.  "If I could call a beer home, this would be the one." ~ Win

It is a mildly hoppy pale ale using a 2 row, vienna, and munich malts for body,color, and head retention. It is hopped with American west coast hops later in the boil giving it a nice citrus hop flavor and very mild aroma. Slight addition of a roasted caramel malt gives "633" it's signature 'sunset over the harbor glow'.','6.33')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('tmEthz','"Admiral" Stache','Milwaukee Brewing Co’s take on a classic European style. Baltic Porters are the stronger lager fermented cousin of the classic London Porter. The higher strength and cold fermentation help to create a smooth, less fruity porter, rich in roasted malt flavors and aromas. The “Admiral” Stache has a deep brown hue with a light caramel head. Toffee and milk chocolate dominate the flavor with subtle hints of dried fruit. One month of aging in Bourbon Barrels imparted a layer of vanilla and oak.

We first developed this beer in 2007. Our first attempted batch of beer at the 2nd street location was a Baltic Porter. What we ended up with became known as “Shake Down Nut Brown”. You can guess what went wrong from there… But, so many things right! Every year that has gone by, the beer has gotten a little bit stronger, in flavor and alcohol.

We use a black malt for the dark rich color and an extra special malt for the dried fruit flavors. Baltic Porters are fermented cold with a lager yeast. That long slow maturation creates a smooth flavor profile. The anticipation of the bourbon barrel aging it the most exciting part of this brew process. We want that oak character with hints of bourbon, we use 3rd run barrels for this result. Each batch has been slightly different from the last.','7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('b7SfHG','"Ah Me Joy" Porter','A robust porter style ale with a twist. This beer has moderate roastiness with a bitter finish, complemented by the sweetness of almond and coconut, which may remind you of a certain candy. Sit back with a pint and you'll say "ah, me joy!"','5.4')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('zcJMId','"Alternating Currant" Sour','Black Currant Kettle Sour.','4.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('UM8GL6','"B" Street Pineapple Blonde','"B" Street Pineapple Blonde is the lightest beer we have on tap.  Our Pineapple Blonde is a great choice for those just being introduced to craft beer.  For those more familiar with ales, our Blonde is a full-bodied ale with a subtle savory pineapple flavor.','4.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('NIaY9C','"B.B. Rodriguez" Double Brown','Caramel. Walnut. Toast. Luxury.','8.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('PBEXhV','"Bison Eye Rye" Pale Ale | 2 of 4 Part Pale Ale Series','The second in the rotating 4-part series of pale ales explores the adventurous boundaries of balancing various hops and unique malts. This particular brew was crafted with a healthy dose of toasted rye malt and a bodacious amount of New Zealand hops. Tropical aromas of melon and pineapple are balanced with a touch of sweet honey and a refreshing snap due to the mix of bittering hops and rye. Unfiltered, adventurous and crushable.','5.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('wRmmdv','"California Crude" Black IPA','Black ale that is aggressively hopped to balance the malt character. This beer is rich and robust with the additions of black malt for a creamy finish.','7.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('EPYNpW','"C’est Noir" Imperial Stout','10.8% ABV 70 IBU’s A rich and creamy stout with loads of roasted barley and roasted oats infused with 70 IBU’s of hop bitterness to balance this really big beer. (SAY NOIR)','10.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('AXmvOd','"Dust Up" Cloudy Pale Ale | 1 of 4 Part Pale Ale Series','The Pale Ale series will feature 4 distinct variations within the Pale Ale category. "Dust Up" Cloudy Pale Ale, the first of the series, showcases caramelized wheat, an abundant amount of earthy forest hops and finishes crisp and snappy. Unfiltered, untamed, yet friendly to consume.','5.4')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('c5pZg5','"EVL1" Imperial Red Ale','10.4% ABV 64 IBU’s Born from a Robust Porter recipe, it shows it origins with coffee and roasted malt notes. A kicked-up red ale with a deep copper red color and a rich, malty sweet flavor.','10.4')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('xBKAka','"Galactic Wrath" IPA','In August 2012, for the First Year Anniversary at our Tap Room and Restaurant, we decided to take two of our favorite Dust Bowl beers…Galaxy Pale Ale and Son of Wrath Double IPA…and formulate a new IPA recipe using elements from both beers. The result was a delicious, bold IPA with the fruity, citrus character and malt backbone of Son of Wrath, as well as the tropical aroma and easy drinkability of Galaxy Pale. It was so popular with our fans, we decided to brew more.','7.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Hr5A0t','"God Country" Kolsch','Good, dense head retention is desirable. Light pearapple-Riesling wine-like fruitiness may be apparent, but is not necessary for this style. Caramel character should not be evident. The body is light to medium-light. This beer has low hop flavor and aroma with medium bitterness. Wheat can be used in brewing this beer. Ale yeast is used for fermentation, though lager yeast is sometimes used in the bottle or final cold conditioning process. Fruity esters should be minimally perceived, if at all. Chill haze should be absent.','5.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('UjFyXJ','"Hey Victor" Smoked Porter','Rooted in Western pop culture, our porter is named for the film, Smoke Signals, and is also related to Sherman Alexie’s story, “This is What it Means to Say, ‘Phoenix, Arizona.’”

Our smoked porter is very approachable; it’s not overly smoky and its blend of malts (Maris Otter, English Brown and chocolate) and hops (East Kent Golding, & Fuggle) will remind you of hikes, s’mores and cool, dusky campfires in the Snowies. Take a growler to the mountains and enjoy its rich color and flavor.','5.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('5UcMBc','"Ignition" IPA','This medium amber beer is infused with a blend of 2-row malted barley and caramel malts. Its balance acquired by using a combination of Pacific Northwest hops for bitterness and aroma.','6.6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('mrVjY4','"Jemez Field Notes" Golden Lager','This straw-blond lager is an easy going brew created to help celebrate the oncoming warm summer months. Luke chose a variety of pilsner malts, to convey delightful bready notes, an even mouthfeel and a clean, refreshing finish. Jemez Field Notes pairs well with exploring the outdoors and getting dirty in the field.','4.9')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('54rSgo','"Jemmy Dean" Breakfast Stout','The stout style lends itself well to pairing with coffee.  Our Jemmy stout uses over eight different malts and has a complexity that is complemented by our special cold-pressed Java Vino blend added into the serving tank - yielding our "Jemmy Dean" breakfast stout.','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('JsKjkk','"Mauvaises Choses"','…meaning “Very Bad Things” in French…

As the name suggests this beer is naughty. She creeps up on you and packs a punch, but the best part about her…she never talks back 

A Belgian Golden Ale brewed with California Golden raisins and Canadian Maple Syrup. Trappist yeast creates a strong phenolic aroma reminiscent of passion fruit, plums, and mangos. French and Czech hops add a complex flavor, while taking care not to obstruct the delicate phenols of the Belgian yeast.

Drink up, but be careful, she’s a feisty one!','7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('b7WWL6','"Mike Saw a Sasquatch" Session Ale','The true Summer Ale of Central Oregon! A Golden Ale, light and smooth. You can taste the craftsmanship in this easy drinking ale with a smooth blend of Cascade and Sterling hops and finished with a touch of Honey malt to balance it out. This is a great introduction if you are new to the world of Craft Brewing.  For established craft enthusiasts, 10 Barrel Summer Ale is a good reprieve from overly hopped and overly malty alternatives.','4.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('HXmS9k','"My" Bock','Amber, malty and not too heavy, all around favorite even for the drinkers of the yellow fizzy stuff','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('giqbO2','"Not Just Some" Oatmeal Stout','Made with two-row pale malt, dark chocolate malt, black malt, and flaked oats - this rich stout is brewed with twelve additions of Fuggle hops.  Originally Just Some Oatmeal Stout, the name was changed by popular demand as this truly is unlike any ordinary stout!','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('HhyVO1','"Pinch" Pilsner','','4.9')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('HZ9xM2','"Ray Brown" Porter','Now that the weather's turned a tad darker, your beer should, too. Get cozy with this ebony beauty, a brown porter that starts with notes of milky light chocolate and vanilla bean before morphing into a winter wonderland of mild coffee and hazelnuts. It's dark, tempting, and delicious, just the way longtime loyal customer Ray Brown likes it.','5.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('ETaM11','"Roux 40" Red IPA','','6.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Gb2aAs','"Small Batch" Hazelwood Farmhouse IPA','','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('TAtY2B','"Sneaky Devil" Double IPA','A light golden double-IPA with plenty of body and malt character to match the aggressive hoppiness. Blends of Columbus and Centennial hops round out the aroma. Don’t let the light color fool you. This beer packs a punch.','7.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('8f8vqK','"Sniff" IPA','','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Dj5OOw','"SuperDude!" Barrel-Aged Russian Imperial Stout','Dude Abide no More! Aging for six months in a Big Bottom Whiskey Barrel, this dark full-bodied stout absorbed maximum amounts of bourbon character and flavor. Rich and smooth, the “SuperDude!” is our best stout yet.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('VnoFfW','"The Great Boo" Pumpkin Ale','Ale brewed with pumpkin and spices.','5.3')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('o9CdUe','"The King" Imperial Elvis Peanut Butter Banana Sandwich Brown Ale','The imperial version of Elvis has twice the peanut butter of the regular elvis and quite a malt bill! Creating a sweet, dense, rich double brown ale with intense peanut butter flavor. This brew will be released once a year during our Annual Elvis Day at the Brewpub celebration in April!','8.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('u1hJXS','"The Reason" Saison','','4.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('1qDm69','"Thick Witted" Kaffir Double Wit','Senior brewer Sam Barber has created this strong Belgian witbier as one of our four anniversary beers.','6.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('dXHJTS','"Thunderkissed" Coffee Infused Milk Stout','Local Columbus coffee roaster Thunderkiss Coffee provides us with freshly roasted coffee beans which we infuse into our milk stout. The result is an amped-up, extra dimension of roastiness.','5.3')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('bw2AS4','"Tractor Beam" Oatmeal Stout','','5.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('kyrjzl','"Turbocharger" Double IPA','','8.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('K83yUU','"Whistleblower" Belgian Wit','Belgian style beer with wheat, barley and oats for a smooth malt character. Additions of elderflower, coriander and orange peel give this traditional wheat beer a spicy character.','5.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('S4DA2h','"Wintah" Ale','Wormtown Brewery's Winter Seasonal is an American Brown Ale. Mahogany Brown in color with malty aroma and hints of toasted brown bread. Medium body highlighting luscious malt flavor and aftertaste of roasty cocoa.

Gold Medal Winner @ GIBF 2010','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('2toTiw','# 100','Our 100th batch, brewed for the enjoyment of the brewers, but popular demand forced us to release it commercially.
This malty, yet light bodied ale has a massive hop bitterness. Most enjoyable in a comfortable chair in front of a roaring fire.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('vX0d37','# 500','When Nøgne Ø decided to make it’s 500thbatch of beer, it was quickly established that the key numbers would be 5 malts, 5 hops, 10% alcohol and 100 IBUs. The result is an incredibly rich and hoppy Imperial IPA. Malty enough to be almost a barley wine, but intensely fruity, mainly because it is dry hopped with generous amounts of Nelson Sauvin hops from New Zealand.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('BVvaGP','#007','','5.3')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('YoKSFm','#1 American','If anything has ever tasted like freedom before, it is F-Town’s signature pale ale, #1 American. The first sip entices you with a slight caramel flavor and is surrounded by notes of fresh citrus. The hints of fresh orange and grapefruit will leave you feeling refreshed.','')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('WfTRD1','#1 Brown Brett Braggot','This beer started its life as a brown ale that just wanted to be a bit more. Our farmer Rally, who picks up spent grains also happens to have a pretty thriving bee business. He transports his hives from state to state pollinating large crops for farms as far south as Georgia peach orchards and up north to Maine for Blueberry fields. Having just returned from a blueberry pollination in Maine and looking to sell off some of his honey we jumped on close to 200 lbs of this liquid gold and added it to the brown ale during secondary fermentation. Also added to the Disco funk tank was a blend of yeast, one a Belgian Saison Yeast and the other, our buddy Brettanomyces (aka Brett). This wild yeast strain adds that slight Belgian Funk to our tank and get’s the disco party started.','6')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('QR1aJr','#1 Fan','100% orange blossom honey.','6.8')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('xFM8w5','#10 Hefewiezen','Northern Pacific Locomotive  #10 was a coal fired tender that worked in the rail yards in Brainerd for decades, switching cars, hauling coal for the power plant, and other duties. After being retired, it stood as a fixture at Brainerd’s Lum Park for years during the 1980’s. It’s the locomotive featured in the picture on our website. By a remarkable coincidence, our hefewiezen ale is the 10th beer that we’ve brewed in our lineup. The German-style wheat beer yeast suspended in the beer adds hints of clove and banana, while the white malted wheat adds a grainy sweetness. Crisp, refreshing, with a dense, white head and light body make this a perfect summer beer.','5.1')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('EliWWJ','#15','White IPA w/ Orange Peel, Coriander, Peaches, & Apricot.','6.7')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('uLkd3a','#2 Brett Golden Sour','This beer had a long weekend in our brew kettle allowing beer bugs (Pediococcus and Latcobacillus) to get down get down and do their sour thang. While yeast strains eat sugar and produce alcohol beer bugs eat sugar and produce acids. This gives sour beers their puckering power. After letting the bugs play in the sweet wort pool we boil the beer and add a touch of earthy hops. Disco Pig #2 Brett Golden Sour is 100% Brett fermented to replicate as closely as possible what a traditional Belgian wild fermented sour beer should be!','6.5')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('Z7tz1C','#2 Strong Ale','Peter entered his home brewed version of this OBBC favorite in the US Beer Tasting Championships in 2010 and came home a winner. It is as delicious as it is unique, a dark amber color with an enticing aroma of fruit and cloves give way to a deep, sweet flavor and smooth finish. We use dark Belgian candy sugar to kick up the alcohol and balance out the assertive Belgian yeast flavors.','10')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('EVWmiT','#34 Oatmeal Stout','','5.2')
SQL: INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES ('PvaOWz','#40 Golden Lager','','')

Open in new window

logfile.csv
0
 

Author Comment

by:Ray Zuchowski
ID: 41820854
Terry ,

The escape strings you gave me kept throwing errors so I kept it out for now.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820860
Terry that's the error im getting with escape strings.

( ! ) Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:\wamp64\www\GetBeers2.php on line 41

Open in new window

0
 

Assisted Solution

by:Ray Zuchowski
Ray Zuchowski earned 0 total points
ID: 41820872
Terry when I run this, It wont copy the description field and ABV and I get a bunch of errors.
foreach($results ['data'] as $result){
	//***--Uncomment below to export to a text file or .csv . This shows the var_dump
    //file_put_contents('/logfile.txt', print_r($result,true)."\n",FILE_APPEND);
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES (
'{$result['id']}',
'".mysqli_real_escape_string($result['name'])."',
'".mysqli_real_escape_string($result['description'])."',
'".mysqli_real_escape_string($result['abv'])."')";
}
  

Open in new window


Error: Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in C:\wamp64\www\GetBeers2.php on line 44
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820881
Apologies; use mysqli::real_escape_string rather than just mysqli_real_escape_string and you should avoid that error.
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820885
I can see from your log entry we still aren't referencing the data structure correctly. I'll get back to you shortly once I've had a chance to look at it further.
0
 

Author Comment

by:Ray Zuchowski
ID: 41820898
ok thanks terry
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41820908
Ok looking at it in more detail, I think we've nearly got it right, but we need the escaping fixed. There's clearly single quotes in both the name and description data.

foreach($results ['data'] as $result){
	//***--Uncomment below to export to a text file or .csv . This shows the var_dump
    //file_put_contents('/logfile.txt', print_r($result,true)."\n",FILE_APPEND);
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description,ABV) VALUES (
'".mysqli::real_escape_string($result['id'])."',
'".mysqli::real_escape_string($result['name'])."',
'".mysqli::real_escape_string($result['description'])."',
'".mysqli::real_escape_string($result['abv'])."')";
}

Open in new window


Escaping the id and abv isn't necessary for the expected data, but it does still help prevent against SQL injection attacks, so it's a security precaution.
0
 

Author Comment

by:Ray Zuchowski
ID: 41821029
Terry,

 I was getting a static string error with that. I had to change it to this.

foreach($results['data'] as $result){
  $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV)
 VALUES (
'{$result['id']}',
   '".$conn->real_escape_string ($result['name'])."',
   '".$conn->real_escape_string ($result['description'])."',
   '".$conn->real_escape_string ($result['abv'])."')";

Open in new window

0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 250 total points
ID: 41821068
Ok, great; is it working ok now?
0
 

Author Comment

by:Ray Zuchowski
ID: 41821592
It works but, i still get errors because in some cases ABV and description isnt present.  Where would i put an IF statement to say IF ABV =Null ignore.
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41821639
set your variables before adding them to the query string

$id          = empty($result['id'])          ? '' : (int)$result['id'];
$name        = empty($result['name'])        ? '' : (int)$result['name'];
$abv         = empty($result['abv'])         ? '' : $conn->real_escape_string($result['abv']);
$description = empty($result['description']) ? '' : $conn->real_escape_string($result['description']);

$sql = "INSERT INTO masterbrewlist    
    (BreweryDbId, BeerName, Description, ABV)
VALUES (
  '{$id}',
  '{$name}',
  '{$description}',
  '{$abv}'";

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41821669
OK guys here is my final code.  1 last issue, the api makes you specify a page number. Each page has a total of 50 beers but, there is 1150 pages. Is there a way i can have the code change the$prams( p=>1) at the end of the pull and change it to increase that variable to +1 ?  

<?php
include ("Brewerydb.php");
echo "
Step 2 GET beers from Brewery DB";


$apikey = '';

$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 
$params=array('/beers','p'=>1);
$results = array();
try {
    
// The first argument to request() is the endpoint you want to call
// 'brewery/BrvKTz', 'beers', etc.
// The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
} catch (Exception $e) {
    $results = array('error' => $e->getMessage());
}

var_dump($results);


$servername = "localhost";
$username = "root";
$password = "";
$dbname = "";

// Create MYSQL connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

foreach($results['data'] as $result){
	
if($result['abv'] == null){
continue;
}
if($result['description'] == null){
continue;
}
  $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV)
VALUES (
'{$result['id']}',
   '".$conn->real_escape_string ($result['name'])."',
   '".$conn->real_escape_string ($result['description'])."',
   '".$conn->real_escape_string ($result['abv'])."')";
      echo 'Processing ' . $result['name'] . '<br />';


if ($conn->query($sql) === TRUE) {
echo "New record created successfully <br>";
} else {
echo "Error: " . $sql . "
" . $conn->error;
}
}
$conn->close();
?>

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41821681
An i forgot i want to add ON DUPLICATE KEY UPDATE for '{$result['id']}'  so basically if that id exists just update the record. How do i code this in ?
0
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 41821812
1150 pages - you need to contain your code in a loop - I would put it in a function where you pass it the connection, and the page and the service to get the beers.
The ON DUPLICATE KEY UPDATE - add to the end of the query as shown below. (table must have a primary key defined)

A few changes to the code
1. Put the work horse in a function\
2. Moved the DB connect out of the function
3. Combined the check for abv and description = null
4. Added the ON DUPLICATE KEY
5. Put Query inside a heredoc
<?php
include ("Brewerydb.php");
echo "
Step 2 GET beers from Brewery DB";
$apikey = '';
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "";

// Create teh service
$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 

// Create MYSQL connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

// Change as required.
$totalpages = 1150;

// Loop through pages
for($i = 1; $i <= $totalpages; $i++) {

  // Call function to populate beers
  populateBeers($conn, $bdb, $i);
}

$conn->close();

function populateBeers($conn, $bdbservice, $page)
{
  // Get the specified page
  $params=array('/beers','p'=>$page);
  $results = array();
  try {
    
  // The first argument to request() is the endpoint you want to call
  // 'brewery/BrvKTz', 'beers', etc.
  // The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
  } catch (Exception $e) {
    $results = array('error' => $e->getMessage());

    // Added this - if this fails then we must return
    return false;
  }

  var_dump($results);
  // Process results
  foreach($results['data'] as $result){
    // Discard unwanted 
    if($result['abv'] == null || $result['description']){
      continue;
    }
    // Query created using HEREDOC
    // Added ON DUPLICATE KEY
    $sql = <<< QUERY
INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV)
    VALUES (
   '{$result['id']}',
   '".$conn->real_escape_string ($result['name'])."',
   '".$conn->real_escape_string ($result['description'])."',
   '".$conn->real_escape_string ($result['abv'])."')
ON DUPLICATE KEY 
  UPDATE id=id
QUERY;
      echo 'Processing ' . $result['name'] . '<br />';


    if ($conn->query($sql) === TRUE) {
      echo "New record created successfully <br>";
    } else {
      echo "Error: " . $sql . "
        " . $conn->error;
    }
  }
}

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41821826
@Julian

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\wamp64\www\GetBeers3.php on line 65
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41821856
Yup - I see you kept the real_escape_string inline - the reason I avoided HEREDOC before. Just change the query back to quotes
    $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV)
    VALUES (
   '{$result['id']}',
   '".$conn->real_escape_string ($result['name'])."',
   '".$conn->real_escape_string ($result['description'])."',
   '".$conn->real_escape_string ($result['abv'])."')
ON DUPLICATE KEY 
  UPDATE id=id";

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41821934
Ok so here is the latest code.  Julian what you sent me earlier with the whole reorganization of the code didnt work. Even after i repasted the diff query.  This is what i have. Duplicate key is now working. Just now have to do the page number. Owner of the API said they want a pause between pages, like 5 seconds so i dont flood their server.  Here is latest code.

<?php
include ("Brewerydb.php");
echo "
Step 2 GET beers from Brewery DB";

#API*************************************INFO
$apikey = '';

$bdb = new Pintlabs_Service_Brewerydb($apikey);
$bdb->setFormat('php'); 
$params = array('p' =>1);
$results = array();

#RUNS************************************API
try {
    
// The first argument to request() is the endpoint you want to call
// 'brewery/BrvKTz', 'beers', etc.
// The third parameter is the HTTP method to use (GET, PUT, POST, or DELETE)
    $results = $bdb->request('beers', $params, 'GET'); // where $params is a keyed array of parameters to send with the API call.
} catch (Exception $e) {
    $results = array('error' => $e->getMessage());
}

#DUMPS API******************************RESULTS
var_dump($results);


#MYSQL CONNECTION***********************INFO
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "";

// Create MYSQL connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

#SQL QUERY******************************SETTINGS
foreach($results['data'] as $result){
	
if($result['abv'] == null){
continue;
}
if($result['description'] == null){
continue;
}
  $sql = "INSERT INTO masterbrewlist (BreweryDbId, BeerName, Description, ABV)
VALUES (
'{$result['id']}',
   '".$conn->real_escape_string ($result['name'])."',
   '".$conn->real_escape_string ($result['description'])."',
   '".$conn->real_escape_string ($result['abv'])."') ON DUPLICATE KEY 
  UPDATE BreweryDbId=BreweryDbId";
      echo 'Processing ' . $result['name'] . '<br />'; 


if ($conn->query($sql) === TRUE) {
echo "New record created successfully <br>";
} else {
echo "Error: " . $sql . "
" . $conn->error;
}
}
$conn->close();
?>

Open in new window

0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41821983
When you say did not work - error's or not required result?

I can't test so what I give you is just a guide - you need to adapt on your side if it does not work out of the box.

If you do it as a function then in the for loop that is calling the function you can delay execution with a sleep() command coupled with a set_time_limit() to ensure you don't flood the server.
for($i =1; $i < $totalpages;$i++) {
  // Make sure the script does not time out
  set_time_limit(60);
  populateBeers($conn, $bdb, $i);
  // pause before next iteration
  sleep(5);
}

Open in new window

0
 

Author Comment

by:Ray Zuchowski
ID: 41822235
With the original code you redid for me... This is the error im getting.

( ! ) Notice: Undefined variable: bdb in C:\wamp64\www\GetBeersNew.php on line 44
Call Stack
#	Time	Memory	Function	Location
1	0.0005	249656	{main}( )	...\GetBeersNew.php:0
2	0.0023	296096	populateBeers( )	...\GetBeersNew.php:29

( ! ) Fatal error: Call to a member function request() on null in C:\wamp64\www\GetBeersNew.php on line 44

Open in new window

0
 

Author Closing Comment

by:Ray Zuchowski
ID: 41822388
Awesome Help
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41822629
Just a note on the error - you will see in my code the bdb variable is injected into the function as bdbservice. The solution therefore was simply to fix the name of the bdb variable in the function to bdbservice. As I mentioned in my previous post, it is not possible to test your code - so it is up to you to make the minor adjustments if what is posted does not work out of the box.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Creating and Managing Databases with phpMyAdmin in cPanel.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now