Lines Matching refs:res
161 #define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docre…
176 Vresult *res = (Vresult *)rsrc->ptr; in _free_birdstep_result() local
178 if ( res && res->values ) { in _free_birdstep_result()
180 for ( i=0; i < res->numcols; i++ ) { in _free_birdstep_result()
181 if ( res->values[i].value ) in _free_birdstep_result()
182 efree(res->values[i].value); in _free_birdstep_result()
184 efree(res->values); in _free_birdstep_result()
186 if ( res ) { in _free_birdstep_result()
187 efree(res); in _free_birdstep_result()
254 static int birdstep_add_result(HashTable *list,Vresult *res,VConn *conn) in birdstep_add_result() argument
258 ind = zend_list_insert(res,php_birdstep_module.le_result); in birdstep_add_result()
259 res->conn = conn; in birdstep_add_result()
260 res->index = ind; in birdstep_add_result()
267 Vresult *res; in birdstep_find_result() local
270 res = zend_list_find(ind,&type); in birdstep_find_result()
271 if ( !res || type != php_birdstep_module.le_result ) { in birdstep_find_result()
274 return(res); in birdstep_find_result()
351 Vresult *res; in PHP_FUNCTION() local
362 res = (Vresult *)emalloc(sizeof(Vresult)); in PHP_FUNCTION()
363 stat = SQLAllocStmt(conn->hdbc,&res->hstmt); in PHP_FUNCTION()
366 efree(res); in PHP_FUNCTION()
369 stat = SQLExecDirect(res->hstmt,query,SQL_NTS); in PHP_FUNCTION()
372 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
373 efree(res); in PHP_FUNCTION()
377 stat = SQLNumResultCols(res->hstmt,&cols); in PHP_FUNCTION()
380 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
381 efree(res); in PHP_FUNCTION()
385 stat = SQLRowCount(res->hstmt,&rows); in PHP_FUNCTION()
388 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
389 efree(res); in PHP_FUNCTION()
392 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
393 efree(res); in PHP_FUNCTION()
396 res->values = (VResVal *)safe_emalloc(sizeof(VResVal), cols, 0); in PHP_FUNCTION()
397 res->numcols = cols; in PHP_FUNCTION()
399 SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_NAME, in PHP_FUNCTION()
400 res->values[i].name,sizeof(res->values[i].name), in PHP_FUNCTION()
402 SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_TYPE, in PHP_FUNCTION()
403 NULL,0,NULL,&res->values[i].valtype); in PHP_FUNCTION()
404 switch ( res->values[i].valtype ) { in PHP_FUNCTION()
407 res->values[i].value = NULL; in PHP_FUNCTION()
412 SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_DISPLAY_SIZE, in PHP_FUNCTION()
414 res->values[i].value = (char *)emalloc(coldesc+1); in PHP_FUNCTION()
415 SQLBindCol(res->hstmt,i+1,SQL_C_CHAR, res->values[i].value,coldesc+1, &res->values[i].vallen); in PHP_FUNCTION()
418 res->fetched = 0; in PHP_FUNCTION()
419 indx = birdstep_add_result(list,res,conn); in PHP_FUNCTION()
429 Vresult *res; in PHP_FUNCTION() local
440 stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); in PHP_FUNCTION()
442 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
448 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
452 res->fetched = 1; in PHP_FUNCTION()
463 Vresult *res; in PHP_FUNCTION() local
484 for ( i = 0; i < res->numcols; i++ ) { in PHP_FUNCTION()
485 if ( !strcasecmp(res->values[i].name,field)) { in PHP_FUNCTION()
495 if ( indx < 0 || indx >= res->numcols ) { in PHP_FUNCTION()
500 if ( !res->fetched ) { in PHP_FUNCTION()
501 stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); in PHP_FUNCTION()
503 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
509 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
513 res->fetched = 1; in PHP_FUNCTION()
515 switch ( res->values[indx].valtype ) { in PHP_FUNCTION()
522 if ( !res->values[indx].value ) { in PHP_FUNCTION()
523 res->values[indx].value = emalloc(4096); in PHP_FUNCTION()
525 stat = SQLGetData(res->hstmt,indx+1,sql_c_type, in PHP_FUNCTION()
526 res->values[indx].value,4095,&res->values[indx].vallen); in PHP_FUNCTION()
528 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
534 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
538 if ( res->values[indx].valtype == SQL_LONGVARCHAR ) { in PHP_FUNCTION()
539 RETURN_STRING(res->values[indx].value,TRUE); in PHP_FUNCTION()
541 RETURN_LONG((zend_long)res->values[indx].value); in PHP_FUNCTION()
544 if ( res->values[indx].value != NULL ) { in PHP_FUNCTION()
545 RETURN_STRING(res->values[indx].value,TRUE); in PHP_FUNCTION()
556 Vresult *res; in PHP_FUNCTION() local
564 SQLFreeStmt(res->hstmt,SQL_DROP); in PHP_FUNCTION()
667 Vresult *res; in PHP_FUNCTION() local
677 if ( indx < 0 || indx >= res->numcols ) { in PHP_FUNCTION()
681 RETURN_STRING(res->values[indx].name,TRUE); in PHP_FUNCTION()
690 Vresult *res; in PHP_FUNCTION() local
698 RETURN_LONG(res->numcols); in PHP_FUNCTION()