Hello,
I'm trying to get mysql data with a simple select statement, I need to get the number of the row as well.
The table should like this:
1 - Song Name, Artist
2 - Song Name, Artist
3 - Song Name, Artist
The problem is with the code I'm using, the output is coming out like this
12345 Rihanna - Song #1
12345 Bon Jovi - Song #2
12345 Bon Jovi - Song #2
12345 Test - Test #1
This is my code, help is very much appreciated.
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM j2mp6_table");
while($row = mysql_fetch_array($result))
{ ?>
<p class="numblocks num-1">
<?
for ($i=1; $i<=5; $i++)
{
echo "<span>" . $i . "</span>";
}
?>
<? echo $row['artiste']; ?> - <? echo $row['chanson']; ?>
</p>
<?
//echo $row['artiste'] . " " . $row['chanson'];
//echo "<br />";
}
mysql_close($con);
?>