Jump to content

ram4nd

Members
  • Posts

    461
  • Joined

  • Last visited

Posts posted by ram4nd

  1. How can I get column type?

     

    I have tried pg_field_type PHP function and information_schema. Both seem not to work.

     

        $link = pg_connect('host='.$db[$active_db]['host'].' user='.$db[$active_db]['username'].' password='.$db[$active_db]['password'].' dbname='.$db[$active_db]['db'].' connect_timeout=5');
        if ($link) {
          $result = pg_query($link, "select a.attname from pg_attribute a, pg_class b where b.relfilenode=a.attrelid and b.relname='".$form_state['values']['query']."' and a.attname not in ('tableoid','cmax','xmax','cmin''xmin','ctid')");
          while ($row = pg_fetch_row($result)) {
            $schema[] = $row;
          }
          foreach($schema as $k => $s) {
            $result = pg_query($link, "select ".$s[0]." from '".$form_state['values']['query']."'");
            $schema[$k][1] = pg_field_type($result, 0);
          }
          pg_close($link);
        }

  2. first of all, your website? You think that everybody figures out to go to your profile and get you website domain from your mail address?

     

    secondly, why would you tel us that

     

    if you ask for help, please post some code as it is coding forum

  3. Thank you for your replays.

     

    I would like to explain some things.

     

    Disan needis improving, I know that.

     

    Snippets are snippets, they don't need explanation. Point isn't to find them via browsing, but from google using certain keywords. Right now all snipets are made by me. Just some useful stuff. Snippets are very specific.

     

    I haven't put much effort on making a community. Its more like, if you find anything useful then good for you. Mostly by google and targeted keywords.

     

    Final point. This site is also a place where i store my code that i reuse. I might always forget something. I also have learned a lot while building it. So the site is not pointless.

  4. I need permanent redirect. Example url: example.com/something/more/more/1

     

    I always have /something/, so it would be awsome if you could remove /1 only from urls where are /something/ for first path argument.

    There can be any number of different url segments in between /something/ and /1, those should be kept there, just /1 should be removed.

     

    So the redirect path of the example url should be example.com/something/more/more

     

     

    How can I do this?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.