Jump to content

PHP MySql Help


joshuaer

Recommended Posts

Your first while ($row = mysql_fetch_assoc($result)) loop used up all your $result (to no useful purpose as far as I could tell). By the time you tried it again it was all gone. You should have either rewound it (not correct term) or you could have repeated your select query.
I think either reseting the pointer or combining the loops would be the best options. No need to make another identical query for the same data you already have.
Link to comment
Share on other sites

Guest So Called

I was just pointing out alternatives. Neither would I make another identical query because that would be wasteful and redundant. At the same time I don't want to design somebody's code for them. Beginners can make mistakes and I hope they learn from their mistakes. Particularly they should learn judgement.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...