1

I cant properly select some data in the database i made. I used postgresql. The error says "Error in SQL query: ERROR: relation "book_flight.customer" does not exist LINE 1: SELECT idno FROM book_flight.customer ^" I tried removing the book_flight, still doesn't work

here is the code:

<?php  

    $db = pg_connect("host=localhost port=5432 dbname=AIRLINE user=postgres password=code");  
    echo 'Connected to: ', pg_dbname($db);

    $result = pg_query($db, "SELECT idno FROM book_flight.customer");
    if (!$result) {
        die("Error in SQL query: " . pg_last_error());
    } 

?> 

table customer is in the schema named book_flight

Sho Locus
  • 21
  • 2

2 Answers2

1

Take a look at this, sounds like names may be case sensitive.

Cannot simply use PostgreSQL table name ("relation does not exist")

Community
  • 1
  • 1
asantaballa
  • 3,919
  • 1
  • 21
  • 22
1

I changed the database name, schema, and table name to small letters. It works. Seems that postgresql changes all to lower case and is case sensitive

Sho Locus
  • 21
  • 2