From 894277e0a367e49630572681f89afa8415e49699 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Mon, 27 May 2013 20:25:15 +0100 Subject: [PATCH] db_query works. Returned object needs to be warped. --- haxe/ItemScheduler.hx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index cec9f27..8efb21a 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -16,11 +16,11 @@ class QueryIterator { private function fetch() { var next : Dynamic = untyped __call__('db_fetch', this.result); - this.nextValue = if(next) Just(next) else Nothing; + nextValue = if(next) Just(next) else Nothing; } public function hasNext() : Bool { - return this.nextValue == Nothing; + return this.nextValue != Nothing; } public function next() : T { @@ -35,7 +35,7 @@ class QueryIterator { } class FA { static public function query(sql: String) { - var result = untyped __call__('db_query', sql); + var result = untyped __call__('db_query', sql, sql); return new QueryIterator(result); } } @@ -56,7 +56,8 @@ class ItemScheduler { } function formatRow(row) { - php.Lib.print('helli'); + var array = php.Lib.hashOfAssociativeArray(row); + php.Lib.print(''+array.get('stock_id')+''); } -- 2.30.2