How safe is auth !== null? Firebase

I've been using Firebase for quite some time, but I only now decided to really look into the security rules. My question is, how safe is "auth !== null"? Yes, I realize that this means that only an authenticated user can access the data, but how ea...
more »

2017-07-19 17:07 (2) Answers

Can't add data to my MySQL database via PHP

I have this PHP script to insert data in my MySQL Database: <?php $servername = "..."; // Host name $username = "..."; // Mysql username $password = "..."; // Mysql password $dbname = "..."; // Database name $conn = new mysqli($server...
more »

2017-07-19 11:07 (4) Answers

Denormalization vs Child/Parent & Nesting

We are designing Elastic Search model for events, their schedules and venues, where the events take place. The design is following: Example of queries we might need: Find events, which are Concerts, between 1/7/2017 and 7/7/2017 Find artis...
more »

2017-07-18 20:07 (1) Answers

Cross Table Dependency/Constraint in SQL Database

Take the example that I have of a table called classes that holds university classes and a table called students that holds students. A class has many students and a student can only take one class. (1 to many relationship). If I had a column in cla...
more »

2017-07-18 20:07 (2) Answers

How to force Postgres using index?

I have the following query that find all id insidePOLYGON(({points})) SELECT id FROM t WHERE ST_DWithin('POLYGON(({points}))', ST_Point(latitude, longitude), 0); The query is slow because it doesn't use (latitude, longitude) index and must compute...
more »

2017-07-18 11:07 (2) Answers

Table Left Join

I'm currently trying to get an output from two tables that I want to join and it seems like I have a block in my mind on how to resolve this. Table 1 has products with unique IDs. ID | (other info) ----------------- AA | BB | CC | Table 2 has th...
more »

2017-07-18 09:07 (2) Answers

Yii 2.0 - Trying to get property of non-object

I try to change the "ID Kategori"(Category ID) to "Nama Kategori" (Category Name), the Category ID is in product table and has a relation to category table. for the gridView im using kartik-v gridView i know the error is at return Html::a($model-&g...
more »

2017-07-16 16:07 (1) Answers

Data layers in REST service

I am wondering on how to design a REST service so that my Data Access Layer (Persistence layer that talks to the database) and my "Business" entities are well separated. By "Business" entities I mean the very objects that are returned to the client, ...
more »

2017-07-16 12:07 (1) Answers

PHP cannot select database even though connected

Just installed MAMP and am learning about php and connecting to my databases. I seem to be able to connect to mysql but can't connect or see any databases in phpMyAdmin. Here's my php code: <?php $user = 'root'; $password = 'root'; $db = 'test...
more »

2017-07-15 07:07 (1) Answers

PostgreSQL storage need of references

I'm heavily using references in a SQL layout and was wondering if that's a bad habit. As I declare a reference with varchar(20), does PostgreSQL doubles the storage usage or just uses a hidden ID to link the values? An example: create table if not ...
more »

2017-07-14 21:07 (3) Answers