php - MySQL select from table depending to other table values -


Sorry for bothering me, but I need a lot of help from you professionals ...

I have table tables: ID, date, menu 1, menu 2, menu 3, menu 4

and

  table 2: < / P>  id, name, something like, some alsy 2   

Table 1 (menu 1, menu 2, menu 3, menu 4) have the ID of the table 2. I need the database query "date" value and from table 2 get four rows in the table (depending on the menu's menu value of 1 table) any suggestions, please?

Read MySQL-Docs and see if it's included in a MySQL-tutorial. There you will find something like this:

Be a spicy with a simple SELECT a JOIN and mySQL as the ID - colum:

  select Table 1. Add table 1 to table 2 from table 1 to Table 2. Id = table 2.ID where table 1.menu1 = "someValue" and Table1.menu2 = "someOtherValue"   

If it runs at a slow speed, then table id-call Try adding INDEX to any one:

  Alternate table Table 1 ADD Index My Index (ID)   

You can tell Select how many rows are being examined

  Select Table 1. 'Date' to Table 1 ...    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -