Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = "SELECT MIN(codigo) AS codigo FROM unidades_medida WHERE descricao = '$dados[2]'";
- $codigoUn = $db->query($sql);
- var_dump($codigoUn);
- /*object(Zend_Db_Statement_Pdo)#39 (9) { ["_fetchMode":protected]=> int(2) ["_stmt":protected]=> object(PDOStatement)#40 (1) { ["queryString"]=> string(73) "SELECT MIN(codigo) AS codigo FROM unidades_medida WHERE descricao = 'CPR'" } ["_adapter":protected]=> object(Zend_Db_Adapter_Pdo_Pgsql)#17 (12) { ["_pdoType":protected]=> string(5) "pgsql" ["_numericDataTypes":protected]=> array(12) { [0]=> int(0) [1]=> int(1) [2]=> int(2) ["INTEGER"]=> int(0) ["SERIAL"]=> int(0) ["SMALLINT"]=> int(0) ["BIGINT"]=> int(1) ["BIGSERIAL"]=> int(1) ["DECIMAL"]=> int(2) ["DOUBLE PRECISION"]=> int(2) ["NUMERIC"]=> int(2) ["REAL"]=> int(2) } ["_defaultStmtClass":protected]=> string(21) "Zend_Db_Statement_Pdo" ["_config":protected]=> array(8) { ["dbname"]=> string(14) "hospitalcenter" ["host"]=> string(9) "localhost" ["username"]=> string(8) "postgres" ["password"]=> string(8) "p@ssw0rd" ["charset"]=> string(4) "utf8" ["persistent"]=> bool(false) ["options"]=> array(2) { ["caseFolding"]=> int(0) ["autoQuoteIdentifiers"]=> bool(true) } ["driver_options"]=> array(0) { } } ["_fetchMode":protected]=> int(2) ["_profiler":protected]=> object(Zend_Db_Profiler)#18 (4) { ["_queryProfiles":protected]=> array(0) { } ["_enabled":protected]=> bool(false) ["_filterElapsedSecs":protected]=> NULL ["_filterTypes":protected]=> NULL } ["_defaultProfilerClass":protected]=> string(16) "Zend_Db_Profiler" ["_connection":protected]=> object(PDO)#19 (0) { } ["_caseFolding":protected]=> int(0) ["_autoQuoteIdentifiers":protected]=> bool(true) ["_allowSerialization":protected]=> bool(true) ["_autoReconnectOnUnserialize":protected]=> bool(false) } ["_attribute":protected]=> array(0) { } ["_bindColumn":protected]=> array(0) { } ["_bindParam":protected]=> array(0) { } ["_sqlSplit":protected]=> array(1) { [0]=> string(68) "SELECT MIN(codigo) AS codigo FROM unidades_medida WHERE descricao = " } ["_sqlParam":protected]=> array(1) { [0]=> string(68) "SELECT MIN(codigo) AS codigo FROM unidades_medida WHERE descricao = " } ["_queryId":protected]=> NULL } */
Advertisement
Add Comment
Please, Sign In to add comment