Search the Community
Showing results for tags 'mysql php group by array'.
-
I have some videos I upload to server for online viewing. Sometimes they are too long and I have to cut them into pieces. I am a beginner in this and I'm a little lost. the idea is this: I have these table in MySQL: and this is my php code I have so far: $sql="SELECT * FROM table_name WHERE type = 'tutorials' and type2='word' and video_id='01' ORDER BY server ASC,format ASC,resolution ASC"; $result = mysql_query($sql); <table> while($row = mysql_fetch_array($result)) { echo "<tr>"; switch ($row['server']) { case "youtube": echo '<td><a href="'; echo $row['short_link'].'"><image youtube/></a></td>'; break; case "vimeo": echo '<td><a href="'; echo $row['short_link'].'"><image vimeo/></a></td>'; break; case "dailymotion": echo '<td><a href="'; echo $row['short_link'].'"><image dailymotion/></a></td>'; break; default: echo '<td><a href="'; echo $row['short_link'].'"></a></td>'; } echo "<td>" . $row['server'] . "</td>"; echo "<td>" . $row['format'] . "</td>"; echo "<td>" . $row['resolution'] . "</td>"; echo "<td>" . $row['size'] . "</td>"; echo "<td>" . $row['user'] . "</td>"; echo "</tr>"; } echo "</table>"; but I need that if the server has parts, put all in a div and appears like this: sometimes the video has more parts, I searched for "group by" but I don't know how to integrate it. How I can do that or What do I need search in google to find examples?