Hello, I have problem with this:\

$conn = db_connect();
$query = "select * from albumy, ciste_media where EAN_kod='$EAN_kod'";

Is this syntax good, when I used two tables? Because when I used one table its go correctly and when I used two tables, its doing problems

8 Years
Discussion Span
Last Post by stalk

you must try with join syntax
did 2 table have a relation...?
example in this, we have relation in noid between 2table

$query="select albumy.* from albumy
left join ciste_media on albumy.noid=ciste_media.noid
where albumy.EAN_kod='$EAN_kod'


This is no good? $query = "SELECT * FROM albumy, ciste_media WHERE albumy.EAN_kod=albumy.'$EAN_kod' and ciste_media.EAN_kod=ciste_media.'$EAN_kod';


How I select from two tables , when every tables have EAN_kod. EAN_kod is unique code and I must find everithing from this both tables. Is this code good for it?Because it find me only everything from table albumy, but no from ciste_media

$query="select albumy.* from albumy left join ciste_media on albumy.EAN_kod=ciste_media.EAN_kod where albumy.EAN_kod='$EAN_kod'";


I don't really get what are you trying to achieve. Are you trying to display all the fields from both tables where there is matches between 2 tables?

Maybe this query can help. This display all the fields from both tables where the rows is match between 2 tables.

select * from albumy
inner join ciste_media
on albumy.EAN_kod = ciste_media.EAN_kod
where albumy.EAN_kod='$EAN_kod'


No I will find every details from this two tables, where EAN_kod='$EAN_kod'

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.