Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: pg_query_params(): Query failed: #36

Closed
Byt3Coin opened this issue Mar 2, 2019 · 2 comments
Closed

Warning: pg_query_params(): Query failed: #36

Byt3Coin opened this issue Mar 2, 2019 · 2 comments

Comments

@Byt3Coin
Copy link

Byt3Coin commented Mar 2, 2019


Warning: pg_query_params(): Query failed: ERROR: relation "users" does not exist LINE 1: SELECT * FROM users WHERE email = $1 ^ in /var/www/html/lib/user.class.php on line 203

Fatal error: Uncaught Exception: Error in: class:user | function:emailcheck in /var/www/html/lib/user.class.php:207 Stack trace: #0 /var/www/html/lib/user.class.php(155): user->emailcheck('abc@123.com') #1 /var/www/html/login.php(60): user->register('abc@123.com', 'abc123', 'abc') #2 {main} thrown in /var/www/html/lib/user.class.php on line 207

Looking at the lines 203 - 207 of user.class.php


$sql = "SELECT * FROM $this->user_table WHERE email = $1";
		$result = pg_query_params($this->link, $sql, $params);
		if ($result === false) {
			$message = 'Error in: class:user | function:emailcheck';
			$code = 1;
			throw new Exception($message, $code);

Checking in postgres DB imported all SQL files to database and edited to suit configuration but error is still throwing.

This is at login.php on submit registration.

Some additional info from psql

                    List of relations
 Schema |      Name      | Type  |  Owner   |    Table    
--------+----------------+-------+----------+-------------
 public | pk_id          | index | postgres | chat
 public | plk_email      | index | postgres | users
 public | subscribers_pk | index | postgres | subscribers
(3 rows)

postgres=# \d users
                                          Table "public.users"
     Column      |     Type      | Collation | Nullable |                    Default                    
-----------------+---------------+-----------+----------+-----------------------------------------------
 email           | text          |           | not null | 
 password        | text          |           |          | 
 auth_code       | text          |           |          | 
 verified        | integer       |           |          | 
 channel_name    | text          |           |          | 
 channel_title   | text          |           |          | 
 stream_key      | character(10) |           |          | 
 display_name    | text          |           |          | 
 profile_img     | text          |           | not null | '/profiles/default/profile_default.png'::text
 api_key         | text          |           |          | 
 chat_jp_setting | text          |           |          | 
 is_admin        | boolean       |           |          | 
 offline_image   | text          |           | not null | '/profiles/default/offline_default.jpg'::text
Indexes:
    "plk_email" PRIMARY KEY, btree (email)
Referenced by:
    TABLE "subscribers" CONSTRAINT "host_account_fk" FOREIGN KEY (host_account) REFERENCES users(email) ON DELETE CASCADE

I am not used to Pgsl DB use so this might be some issue from setup.
Any advice or help would be great.

Thanks

@Byt3Coin
Copy link
Author

Byt3Coin commented Mar 2, 2019

Issue can be closed.
Found to be configuration error.

@Byt3Coin Byt3Coin closed this as completed Mar 2, 2019
@JochemFB
Copy link

Well, thanks for telling what the fix was

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants