Ad Widget

Collapse

how to get ip using SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tyommik
    Junior Member
    • Jan 2013
    • 8

    #1

    how to get ip using SQL

    Hello! I've tryed to get hosts ip by sql. For example sql query
    PHP Code:
    SELECT ip FROM hosts,interface WHERE hosts.hostid =10228
    lists array but i want just ip of necessary host.

    Thanks!
  • neilb
    Member
    • Jan 2013
    • 33

    #2
    try instead : sql >

    select * from interface


    and join that back to the host table if required using hostid.

    N.

    Comment

    • tyommik
      Junior Member
      • Jan 2013
      • 8

      #3
      Thank you for reply!
      Right answer "select ip FROM interface WHERE hostid = 10233". RTFM

      Comment

      • neilb
        Member
        • Jan 2013
        • 33

        #4
        no worries. The db schema actually uses obvious names for the tables, which is quite a relief versus some other systems!

        the only weird one I've found so far is that templates are actually stored as hosts (in the hosts table).

        Comment

        Working...