Only get the bank’s final value

Asked

Viewed 51 times

0

I’m using the php with Pdo to query a database in postgress.

Is there any way that when you do the query, show the result without having to enter the table name, since select is unique?

select distinct a as origem 
 from b union select distinct  as dest form b

php

for ($x = 0; $x < $stmt->rowCount(); $x++) {
    $n[] = $stmt->fetch(PDO::FETCH_ASSOC);
    }

This way if you put the table name, I know if you do $row['origem'] works but there may be the dest also.

  • I don’t understand, where do you want to enter the name of the table? if you don’t enter the name as the bank will know in which table you want to do the survey.

  • 1

    Do you want to not enter the table or field name? Because in the case as I understand it, your "$Row['origin']", "origin" is not the name of the table, but the nickname given to the field

  • 1

    I don’t know if this is it but lemdoas metadata tables http://www.postgresql.org/docs/8.1/static/catalogs.html mount dynamic sqls , this would be the idea ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.