Lines Matching refs:res

162 #define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docre…
177 Vresult *res = (Vresult *)rsrc->ptr; in _free_birdstep_result() local
179 if ( res && res->values ) { in _free_birdstep_result()
181 for ( i=0; i < res->numcols; i++ ) { in _free_birdstep_result()
182 if ( res->values[i].value ) in _free_birdstep_result()
183 efree(res->values[i].value); in _free_birdstep_result()
185 efree(res->values); in _free_birdstep_result()
187 if ( res ) { in _free_birdstep_result()
188 efree(res); in _free_birdstep_result()
255 static int birdstep_add_result(HashTable *list,Vresult *res,VConn *conn) in birdstep_add_result() argument
259 ind = zend_list_insert(res,php_birdstep_module.le_result); in birdstep_add_result()
260 res->conn = conn; in birdstep_add_result()
261 res->index = ind; in birdstep_add_result()
268 Vresult *res; in birdstep_find_result() local
271 res = zend_list_find(ind,&type); in birdstep_find_result()
272 if ( !res || type != php_birdstep_module.le_result ) { in birdstep_find_result()
275 return(res); in birdstep_find_result()
352 Vresult *res; in PHP_FUNCTION() local
363 res = (Vresult *)emalloc(sizeof(Vresult)); in PHP_FUNCTION()
364 stat = SQLAllocStmt(conn->hdbc,&res->hstmt); in PHP_FUNCTION()
367 efree(res); in PHP_FUNCTION()
370 stat = SQLExecDirect(res->hstmt,query,SQL_NTS); in PHP_FUNCTION()
373 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
374 efree(res); in PHP_FUNCTION()
378 stat = SQLNumResultCols(res->hstmt,&cols); in PHP_FUNCTION()
381 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
382 efree(res); in PHP_FUNCTION()
386 stat = SQLRowCount(res->hstmt,&rows); in PHP_FUNCTION()
389 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
390 efree(res); in PHP_FUNCTION()
393 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
394 efree(res); in PHP_FUNCTION()
397 res->values = (VResVal *)safe_emalloc(sizeof(VResVal), cols, 0); in PHP_FUNCTION()
398 res->numcols = cols; in PHP_FUNCTION()
400 SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_NAME, in PHP_FUNCTION()
401 res->values[i].name,sizeof(res->values[i].name), in PHP_FUNCTION()
403 SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_TYPE, in PHP_FUNCTION()
404 NULL,0,NULL,&res->values[i].valtype); in PHP_FUNCTION()
405 switch ( res->values[i].valtype ) { in PHP_FUNCTION()
408 res->values[i].value = NULL; in PHP_FUNCTION()
413 SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_DISPLAY_SIZE, in PHP_FUNCTION()
415 res->values[i].value = (char *)emalloc(coldesc+1); in PHP_FUNCTION()
416 SQLBindCol(res->hstmt,i+1,SQL_C_CHAR, res->values[i].value,coldesc+1, &res->values[i].vallen); in PHP_FUNCTION()
419 res->fetched = 0; in PHP_FUNCTION()
420 indx = birdstep_add_result(list,res,conn); in PHP_FUNCTION()
430 Vresult *res; in PHP_FUNCTION() local
441 stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); in PHP_FUNCTION()
443 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
449 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
453 res->fetched = 1; in PHP_FUNCTION()
464 Vresult *res; in PHP_FUNCTION() local
485 for ( i = 0; i < res->numcols; i++ ) { in PHP_FUNCTION()
486 if ( !strcasecmp(res->values[i].name,field)) { in PHP_FUNCTION()
496 if ( indx < 0 || indx >= res->numcols ) { in PHP_FUNCTION()
501 if ( !res->fetched ) { in PHP_FUNCTION()
502 stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); in PHP_FUNCTION()
504 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
510 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
514 res->fetched = 1; in PHP_FUNCTION()
516 switch ( res->values[indx].valtype ) { in PHP_FUNCTION()
523 if ( !res->values[indx].value ) { in PHP_FUNCTION()
524 res->values[indx].value = emalloc(4096); in PHP_FUNCTION()
526 stat = SQLGetData(res->hstmt,indx+1,sql_c_type, in PHP_FUNCTION()
527 res->values[indx].value,4095,&res->values[indx].vallen); in PHP_FUNCTION()
529 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
535 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
539 if ( res->values[indx].valtype == SQL_LONGVARCHAR ) { in PHP_FUNCTION()
540 RETURN_STRING(res->values[indx].value,TRUE); in PHP_FUNCTION()
542 RETURN_LONG((long)res->values[indx].value); in PHP_FUNCTION()
545 if ( res->values[indx].value != NULL ) { in PHP_FUNCTION()
546 RETURN_STRING(res->values[indx].value,TRUE); in PHP_FUNCTION()
557 Vresult *res; in PHP_FUNCTION() local
565 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
668 Vresult *res; in PHP_FUNCTION() local
678 if ( indx < 0 || indx >= res->numcols ) { in PHP_FUNCTION()
682 RETURN_STRING(res->values[indx].name,TRUE); in PHP_FUNCTION()
691 Vresult *res; in PHP_FUNCTION() local
699 RETURN_LONG(res->numcols); in PHP_FUNCTION()