<?php $id=$_SESSION['user_id']; $fetch=mysql_query("SELECT * FROM music WHERE user=$id limit 10") or die(mysql_error()); echo("<tr> <td>Title</td> <td>Composer</td> <td>Type</td> </tr>"); while($row = mysql_fetch_array($fetch)) { echo("<tr> <td>"); echo $row['title']; echo("</td>"); echo("<td>"); echo $row['composer']; echo("</td>"); echo("<td>"); echo $row['type']; echo("</td>"); echo("</tr>"); } ?>
As I go, it's probably syntax, but I can't figure it out. After a while, I figured out I was missing three semicolons, but it still doesn't work. Developing locally. Trimmed it down to something here.
You can see what I'm doing--selecting from mysql table and spitting out the first 10 results in a table. Yes, a table. My first use of tables.
@karlpcrowley actually no. I'm starting to think it's something with my include. I guess assos would be better...why didn't I think of that. But it still doesn't work.
@TT_Mark they're right around this PHP, I just didn't copypaste them.
As I go, it's probably syntax, but I can't figure it out. After a while, I figured out I was missing three semicolons, but it still doesn't work. Developing locally. Trimmed it down to something here.
You can see what I'm doing--selecting from mysql table and spitting out the first 10 results in a table. Yes, a table. My first use of tables.
But the table doesn't show up. That don't help.
Does it print the first line of the table that is outside the while loop?
@TT_Mark they're right around this PHP, I just didn't copypaste them.
error_reporting( -1 );. It really does help.I'm starting to think it's my include.
I put die() there so that the rest of my page will load, but it's not working.
@traq what exactly does that do?
I'd also echo out mysql_num_rows( $fetch ) just to make sure you're actually returning rows
Just like it always does, it works for some random reason now. Either include or require works. Thanks for all your help!
Red