query problems

So for some, probably very obvious reason, this is only giving me the first result from the database even though there are more that meet the criteria. Could someone please tell me what I’m doing wrong. I know it must be something simple but I’m totally stumped.

[php] $query1 = "SELECT interest FROM interests WHERE profileid = '{$profileid}' "; $result1 = mysql_query($query1, $connection) or die(mysql_error()); $savedinterests = mysql_fetch_assoc($result1); print_r($savedinterests); [/php]

hello yguyjosh, use below code

[php]
// use it
while($row = mysql_fetch_array($result1))
{
echo ‘

’;
print_r($row)
echo “
”;
}

[/php]
Instead of your below code

[php]
/replace this code with above code.
$savedinterests = mysql_fetch_assoc($result1);
print_r($savedinterests);
[/php]

I hope this will helpful for you.
Reply your feedback
SR

Sponsor our Newsletter | Privacy Policy | Terms of Service