Databases: DB Select Issues.

Databases: DB Select Issues.

by Andrew Smit -
Number of replies: 2
I'm not sure if this is the right forum to be posting this, but it is a DB issue.

I have tableA (10 rows) and tableB (5 rows).
When I do: $sql_records =  get_records_sql('SELECT * FROM tableA, tableB');
It returns 10 rows
When I do $sql_records = get_records_sql('SELECT * FROM tableB, tableA');
It returns 5 rows

All the has changed is the order of tables in the join. Moreover the output is wrong, it should return 50rows (ie. 5row x 10rows)

I'm I missing something here??
andrew.

Average of ratings: -
In reply to Andrew Smit

Re: Databases: DB Select Issues.

by Martín Langhoff -
The get_records family of functions assume a unique "id" column is being returned. Your select may be returning duplicate IDs.