Solution 1: [query and sort two tables and determine which table is data based on passing parameters] function: search for the whole city (including the houses released by the House manufacturer and the houses registered and released by the individual [intermediary] online-the two houses are listed in two different forms: mhouse_info and uhouse_info)
Now the problem arises:
How to sort [real estate agents publish houses in front and individual houses in the back ]!!
Second, how can we determine which table is the house? (the primary key of fht_mhouse_info and fht_uhouse_info is hid [which can be modified at will ]),
It mainly determines the table from which the house is located, and then transmits the corresponding table according to the parameter to query the details of the house]
Reply to discussion (solution)
Mysql_field_table obtains the name of the table where the specified field is located.
During horizontal join, you can assign recognizable column names
You can append a table name to a vertical join.
Mysql_field_table obtains the name of the table where the specified field is located.
During horizontal join, you can assign recognizable column names
You can append a table name to a vertical join.
Moderator, my level is limited! I hope you can elaborate on it. Another problem is to use MySQL as much as possible, because it will be Android development and Android processing .. Online ..
You have no details. how can I do this?
Mysql_field_table obtains the name of the table where the specified field is located.
During horizontal join, you can assign recognizable column names
You can append a table name to a vertical join.
During horizontal join, you can assign recognizable column names
You can append a table name to a vertical join.
These two sentences are not very understandable .. How can I sort two tables? which tables are connected or what are you talking about?
You have no details. how can I do this?
Well, let me describe it in detail.
The reason for separating these two tables is that there are many different attributes in the table. the personal property content is simpler and the property content released by the real estate agent is more complex, so sometimes two tables are separated for query efficiency (not null, number of fields, number of database records, etc. Mhouse_info [housing supplier information table], uhouse_info [user's personal housing information table]), but they all belong to new houses (all houses released by property manufacturers are new houses, an individual can also publish a rental housing [another table] and a new house {second-hand house }).
Now there is a sorting problem in the whole city: [the houses released by the overall sorting house manufacturer are listed in the front, and the houses released by the individual are listed in the back of the houses of the House manufacturer ]. The second is how to determine which table is the house (mysql_field_table () -- I just went to Baidu and learned about this function, you can get the table name [what I need] and then write the if statement based on the retrieved table name (the query statement must list the fields to be queried, otherwise, * is very inefficient ). Thanks to the moderator, there is a sorting problem ..
Closed the post .. I think the problem is complicated and I will solve it myself...