Answer the question
In order to leave comments, you need to log in
Why doesn't the cycle stop?
Hello!
I have a database with 2 tables (epg and channel), they have 2 identical columns - id_channel.
For a test, I'm trying to connect 2 tables (to use records) and output them.
$result = mysql_query("SELECT `epg`.id_channel AS id_channel_epg, `channel`.id_channel AS id_channel_channel FROM `epg`, `channel`", $link);
while($row = mysql_fetch_array($result)){
echo $row['id_channel'];
}
Answer the question
In order to leave comments, you need to log in
I highly doubt it will be infinite. You have written a complete Cartesian product of tables. So the number of rows in the output will be equal to the product of the number of rows in the first table by the number of rows in the second table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question