db_query works. Returned object needs to be warped.
authorMaxime Bourget <bmx007@gmail.com>
Mon, 27 May 2013 19:25:15 +0000 (20:25 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Mon, 27 May 2013 19:25:15 +0000 (20:25 +0100)
haxe/ItemScheduler.hx

index cec9f27e30439e2dd4329fb320be616594742d5d..8efb21ad10b27cbcc4a90ce34114f206ba22c416 100644 (file)
@@ -16,11 +16,11 @@ class QueryIterator<T> {
 
        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<T> {
 }
 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('<tr><td>helli</td></tr>');
+               var array = php.Lib.hashOfAssociativeArray(row);
+               php.Lib.print('<tr><td>'+array.get('stock_id')+'</td></tr>');
                
        }