Jump to content

newbie data looping


stvchez

Recommended Posts

I'm trying to loop data results and alittle stuck.


    $query = "SELECT * FROM  aeWorkoutRuns where username='$username'";
    $result = mysql_query($query, $link);
// get number of rows
$num=mysql_numrows($result);

// set variables
$run_title=mysql_result($result,$i,"run_title");
$route_url=mysql_result($result,$i,"route_url");

// Write the Name and Age inserted into Mysql Database
echo "<table width=400><tr><td>Run Title</td><td>Route URL</td></tr>";
$i=0;
while ($i < $num) {
echo "<tr><td>";
echo "$run_title </td><td>";
echo "$route_url </td></tr>";

$i++;
}

echo "</table>";
?>


///////////////

this is what I get:

Run Title Route URL
Los Altos Loop #5 gmap.loop.number5
Los Altos Loop #5 gmap.loop.number5


These should be unique.  thanks.
Link to comment
https://forums.phpfreaks.com/topic/36368-newbie-data-looping/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.