Toggle navigation
Email or Username
Password
Remember
Login
Register
|
I forgot my password
Questions
Unanswered
Tags
Users
Ask a Question
How to get data table part of the query?
0
like
0
dislike
5
views
There is a table with the recipe in this table refers to table ingredients. How to get php array counter containing an array of ingredients? In each iteration of the foreach to query for the ID of the recipe?
php
sql
asked
Apr 12, 2019
by
vesh95
|
5
views
answer
comment
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
2
Answers
0
like
0
dislike
Can use a SQL where in to obtain the ingredients for recipes id.
PS
You have 1 ingredient is with only one recipe? It is better to use a single table ingredients and binders table recipes <-> ingredients
answered
Apr 16, 2019
by
amorphis
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Use JOIN. Like this.
SELECT * FROM recipes INNER JOIN ingredients ON recipes.id = ingredients.recipe_id
Read more about JOIN:
*
https://anton-pribora.ru/articles/mysql/mysql-join/
*
https://habr.com/post/44807/
*
https://dev.mysql.com/doc/refman/8.0/en/join.html
answered
Apr 16, 2019
by
vesh95
ask related question
comment
Please
log in
or
register
to add a comment.
Related questions
0
like
0
dislike
1
answer
How to write a query that would be out of the date range to get the value, given the amount of time in the requested period for data in a table?
asked
May 10, 2019
by
Recosh
mysql
sql
0
like
0
dislike
2
answers
How to check whether part of the text in the table?
asked
May 11, 2019
by
lilikon
sql
sql-server
0
like
0
dislike
1
answer
Sql query, a simple table, the big data why the long duration?
asked
Apr 11, 2019
by
WannaBePro
sql
0
like
0
dislike
1
answer
The output of the query comparing 2 tables. If the file from one table that coincides with the file id from the second table, list everything else but him?
asked
Apr 27, 2019
by
RetardedDeveloper
php
sql
0
like
0
dislike
1
answer
How to write the query in a temporary table?
asked
Jun 7, 2019
by
oleja1ee7
mysql
sql
Most popular tags
javascript
php
css
html
jquery
wordpress
python
linux
web-development
mysql
android
windows
java
layout
c#
computer-networks
node.js
cpp
iron
yii
vue.js
1C-Bitrix
react
laravel
django
nginx
system-administration
search-engine-optimization
api
ubuntu
the-it-education.
ajax
sql
programming
hosting
cms
design
apache
google-chrome
bootstrap
Vkontakte
macos
google
network-administration
git
laptops
algorithms
regular-expressions
unity-game-engine
email
angular
database
network-equipment
software
wooŃommerce
debian
.net
ios
information-security
video
law-in-it
browsers
books
parsing
wi-fi
game-development
career
htaccess
postgresql
telegram
mikrotik
mobile-development
ruby-on-rails
the-domain-name-system
modx
Yandex
c
json
opencart
Habr
freelance
vpn
asp.net
windows-server
symfony
bots
hard-drives
math
qt
DIY
audio
frontend
payment-system
bash
electronics
gulp.js
user-interface
docker
online-shopping
110,608
questions
257,186
answers
0
comments
33,911
users