macpeace
09-11-2009, 03:26 PM
Hi all;
Iam new in php so I need someone's help.
I Have 2 tables:
categorias - id_cat, nome_cat
and
catalogo - id, id_cat, nome, img_id, nome, desc, status
My question is this: Iam using this SELECT to get values as describe in the select...but with error's, and I cant fix this.
$sql = "(SELECT id , nome FROM `catalogo`) UNION ( SELECT id , nome_cat FROM `categorias` WHERE id_cat = 'categorias.id_cat')";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
Iam new in php so I need someone's help.
I Have 2 tables:
categorias - id_cat, nome_cat
and
catalogo - id, id_cat, nome, img_id, nome, desc, status
My question is this: Iam using this SELECT to get values as describe in the select...but with error's, and I cant fix this.
$sql = "(SELECT id , nome FROM `catalogo`) UNION ( SELECT id , nome_cat FROM `categorias` WHERE id_cat = 'categorias.id_cat')";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))