summaryrefslogtreecommitdiff
path: root/demos/sqlmap-docs/protected/pages/Manual/CodingExamples.page
diff options
context:
space:
mode:
Diffstat (limited to 'demos/sqlmap-docs/protected/pages/Manual/CodingExamples.page')
-rw-r--r--demos/sqlmap-docs/protected/pages/Manual/CodingExamples.page55
1 files changed, 55 insertions, 0 deletions
diff --git a/demos/sqlmap-docs/protected/pages/Manual/CodingExamples.page b/demos/sqlmap-docs/protected/pages/Manual/CodingExamples.page
new file mode 100644
index 00000000..bbd1488e
--- /dev/null
+++ b/demos/sqlmap-docs/protected/pages/Manual/CodingExamples.page
@@ -0,0 +1,55 @@
+<com:TContent ID="body">
+<h1>Cookbook sample</h1>
+
+<h2>Executing Update (insert, update, delete)</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+$product = new Product();
+$product->setId(1);
+$product->setDescription('Shih Tzui');
+
+$key = $sqlMap->insert('insertProduct', $product);
+</com:TTextHighlighter>
+
+<h2>Executing Query for Object (select)</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+$key = 1;
+$product = $sqlMap->queryForObject ('getProduct', $key);
+</com:TTextHighlighter>
+
+
+<h2>Executing Query for Object (select) With Preallocated Result Object</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+$customer = new Customer();
+
+$sqlMap->beginTransaction();
+
+$sqlMap->queryForObject('getCust', $parameter, $customer);
+$sqlMap->queryForObject('getAddr', $parameter, $customer);
+$sqlMap->commitTransaction();
+</com:TTextHighlighter>
+
+<h2>Executing Query for List (select)</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+$list = $sqlMap->queryForList ('getProductList');
+</com:TTextHighlighter>
+
+<h2>Executing Query for List (select) With Result Boundaries</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+$list = $sqlMap->queryForList ('getProductList', $key, null, 0, 40);
+</com:TTextHighlighter>
+
+<h2>Executing Query for Paginated List (select)</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+$list = $sqlMap->queryForPagedList ('getProductList', null, 10);
+$list->nextPage();
+$list->previousPage();
+</com:TTextHighlighter>
+
+<h2>Executing Query for Map</h2>
+<com:TTextHighlighter Language="php" CssClass="source">
+ $map = $sqlMap->QueryForMap('getProductList', null, 'productCode');
+ $product = $map['EST-93'];
+</com:TTextHighlighter>
+
+
+</com:TContent> \ No newline at end of file