-1
You’re making that mistake:
Unknown column 'b.id2' in 'Where clause'
Php packages.
include ("config.php");
$tabla2 = mysql_query("SELECT * FROM tb_buyref b, tb_refset r WHERE r.id=".$id." AND b.id2=".$id) or die(mysql_error()); // selecciono todos los registros de la tabla usuarios, ordenado por nombre
while($registro2 = mysql_fetch_assoc($tabla2)){
Someone could help me?
id2
does not exist in table, prints sql and direct test in database.– rray
@lost the table must exist, what does not exist is the id2 field in table tb_buyref
– Filipe Moraes
Try to explain the purpose of the code and the context of the problem. It seems that you want to make a
join
in tables, for this it is necessary that both have some columnid
in common. The query can be rewritten as:SELECT * FROM tb_buyref b INNER JOIN tb_refset r ON b.id = r.id WHERE b.id = $id
– rray