< /p>
As shown in the figure, a User has multiple topics, and each topic has a corresponding theme.
Please tell me how to implement this relationship using php+mysql?
给我你的怀抱2017-05-16 13:05:29
Do you mean the actual table structure, or how to query this data form
I don’t know if you wrote it in a framework or natively
// 查詢USER表
$returndata = array();
while($userdata = mysql_fetch_assoc()) {
$id = $userdata['id'];
//跟著根據id查詢topics
$topicssql = "";
.....
$userdata['topics'] = array();
while($topicsd = mysql_fetch_assoc()) {
$userdata['topics'][] = $topicsd;
}
}