CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Location
    Dallas, TX
    Posts
    47

    [RESOLVED] Loop Problem!

    Trying to code a news section for the first page of of my site. I have it set to loop to retrieve all news articles with section value of 1 from the database.

    Code:
    while($myrow=mysql_fetch_array($result))
    But the way the script is running will only display 1 result. If the top (first) result is no longer valid eg. make give the message a deleted value. It will display the next result. But will not list more than 1 at a time. I've attached the file to this post. Any and all help is appreicated.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Loop Problem!

    You have two SQL queries with the same variable names. Change the second SQL query variable names.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Aug 2006
    Location
    Dallas, TX
    Posts
    47

    Re: Loop Problem!

    That got it thx bro. Appreciate the help.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Loop Problem!

    Quote Originally Posted by cypher5783
    That got it thx bro. Appreciate the help.
    You're welcome.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured