Problem
I am trying to get all records related to girls_id , as well as their average rating.
Main Girls Table
Table Name: "girls"
Desc: Each girl has their own unique record.
Main Girls Rating Table
Table Name: "rating"
Desc: Each girl can have many records in this table.
EVEN BETTER
Even better would be to add a WHERE clause defining the girls_id , so I can call this at will for an individual person.
Thanks for helping with my first post!
I am trying to get all records related to girls_id , as well as their average rating.
Main Girls Table
Table Name: "girls"
Desc: Each girl has their own unique record.
Code:
+----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+----------------+
| girls_id | int(11) | NO | PRI | NULL | auto_increment |
| girls_name | varchar(255) | NO | | NULL | |
| girls_isActive | int(11) | NO | | NULL | |
| girls_city | varchar(255) | YES | | NULL | |
| girls_desc | longtext | YES | | NULL | |
| girls_photo | varchar(255) | YES | | NULL | |
+----------------+--------------+------+-----+---------+----------------+
Main Girls Rating Table
Table Name: "rating"
Desc: Each girl can have many records in this table.
Code:
+-----------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------+------+-----+---------+----------------+
| rating_id | int(11) | NO | PRI | NULL | auto_increment |
| girls_id | int(11) | NO | | NULL | |
| rating | int(11) | NO | | NULL | |
| rated_by_userid | int(11) | NO | | NULL | |
+-----------------+---------+------+-----+---------+----------------+
EVEN BETTER
Even better would be to add a WHERE clause defining the girls_id , so I can call this at will for an individual person.
Thanks for helping with my first post!