What is the correct form in the return of treatment

Asked

Viewed 44 times

1

Good afternoon friend, I am with a wrong treatment and I would like to solve. I am not being able to see the information.

Code line

<option value="<?php echo $results[0]['id_vendedor']; ?>"><?php echo $results[1]["nome_vendedor"]; ?></option>
  • What information do you see in each one? Could you assemble tables in your question to facilitate understanding?

  • If you are viewing the records from 1 to 4 correctly, then it seems to me that there is nothing wrong with the select, but with the data. As you are using INNER JOIN then it is necessary that the references of the items exist in all tables involved in SELECT. If you replace it with LEFT JOIN you guarantee that CADASTRO_CLIENTES will come, of course if it exists, regardless of whether the link record exists in the others or not.

1 answer

1

I was able to solve it like this: It turns out I was always getting the next index, so when I got to the last index, it played for +1, and this index didn’t exist.

<option value="<?php echo $results[0]['id_revenda']; ?>"><?php echo $results[0]["nome_revenda"]; ?></option>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.