While loop, need help...
Posted: Wed May 27, 2009 4:29 pm
Heya,
So I'm working on a site and I have a while loop that displays the users current projects, their past projects and their contact information. Each section has a title which should only occur once, but since it's in the while loop, it will repeat as many times as their are records. How can I ensure the titles only occur once? Here's a code sample: (thanks!)
So I'm working on a site and I have a while loop that displays the users current projects, their past projects and their contact information. Each section has a title which should only occur once, but since it's in the while loop, it will repeat as many times as their are records. How can I ensure the titles only occur once? Here's a code sample: (thanks!)
Code: Select all
<?php
$get_client_data = mysql_query("SELECT * FROM `top-secret`, `top-secret` WHERE `top-secret` = '$top-secret' AND `top-secret` = '$top-secret'") or die(mysql_error());
echo '<h3>Your Current Projects</h3>';
while ($insert_client_data = mysql_fetch_array($get_client_data, MYSQL_ASSOC)) {
stuff
}
echo "<h3 id='toggle-your-profile'>Edit Your Profile >></h3>";
while ($insert_client_data = mysql_fetch_array($get_client_data, MYSQL_ASSOC)) {
echo "stuff";
}
?>