title: DynamoDb - Integer can not be converted to an String
body: <p>I'm new to dynamoDB and am struggling to populate my DynamoDB table which I have defined the table as follows:</p>
  
  <pre><code>    $response = $DynamoDb-&gt;createTable([
          'TableName' =&gt; 'products',
          'AttributeDefinitions' =&gt; [
              [
                  'AttributeName' =&gt; 'product_code',
                  'AttributeType' =&gt; 'N'
              ],
              [
                  'AttributeName' =&gt; 'created_at',
                  'AttributeType' =&gt; 'N'
              ],
          ],
          'KeySchema' =&gt; [
              [
                  'AttributeName' =&gt; 'product_code',
                  'KeyType' =&gt; 'HASH' 
              ],
              [
                  'AttributeName' =&gt; 'created_at',
                  'KeyType' =&gt; 'RANGE' 
              ]
          ],
          'ProvisionedThroughput' =&gt; [
              'ReadCapacityUnits'    =&gt; 5,
              'WriteCapacityUnits' =&gt; 6
          ]
      ]);
  </code></pre>
  
  <p>and populated using</p>
  
  <pre><code>    $result = $DynamoDb-&gt;putItem([
        'TableName' =&gt; 'products',
          'Item' =&gt; [
            'product_code' =&gt; ['N'  =&gt;  (int)$row[0]],
            'created_at' =&gt; ['N' =&gt; (int)strtotime("now")]
          ]
      ]);
  </code></pre>
  
  <p>I keep getting the error </p>
  
  <pre><code>Integer can not be converted to an String
  </code></pre>
  
  <p>Can anybody please advise a newbie. Many thanks.</p>