I've been puzzling for 3 days already, tried everything (LEFT JOIN, etc.).
The bottom line is a while loop that prints all the data from mysql from the zvonki table. In the end, everything is displayed in a table format, as needed. I can edit each cell with x-editable.
The question is, there is a napravlenie table, this table has a list of acceptable values. That is, in 1 cell I want to prohibit adding chaotic values, so I entered valid values in the napravlenie table. When adding a record to the table, everything works fine, using a while loop, I output all the values in select / option. But it is necessary for me, that and at editing it would give out values only from the napravlenie table.
As a result, my logic looks like this:
$result = mysqli_query($link, 'SELECT * FROM zvonki ORDER BY id DESC') $result2 = mysqli_query($link, "SELECT * FROM napravlenie") while( $row = mysqli_fetch_assoc($result) ){ ... while( $row2 = mysqli_fetch_assoc($result2) ){ .... } ... } The cycle is interrupted when it comes to 2 cycles
mysqli_query($link, "SELECT * FROM napravlenie");will choose the same thing . There is absolutely no point in doing this in a loop. - u_mulder$resultvariable. - u_mulder