Skip to content

Instantly share code, notes, and snippets.

@shahariaazam
Created February 7, 2013 07:21
Show Gist options
  • Save shahariaazam/4729174 to your computer and use it in GitHub Desktop.
Save shahariaazam/4729174 to your computer and use it in GitHub Desktop.
<?php
$stmt = $pdo->prepare("SELECT ItemSales.date,
ItemSales.price,
ItemSales.price * ItemSales.quantity as earnings
FROM ItemSales as sales,Items
WHERE ItemSales.itemId = Items.id
AND Items.id = :Items_id"); // Note: :Items.id change to :Items_id
$stmt->bindParam(':Items_id', $id); // Note: 'Items.id' change to ':Items_id'
$stmt->execute();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment