Using a mysql_query more then once?

I’ve had some trouble using a mysql_query more then one time. I was using it in a loop then I tried using it again and it refused to work. So I copied the result and renamed it to be one number up to $result4 and it worked perfectly.

So I’m wondering are you not allowed to use a result/mysql_query more then once?

Of cause u are allowed 2 use mysql_query as often as u want.
Ur solution was 100% correct.

I had a variable called $result3 and it did this: $result3=mysql_query(“SELECT * FROM bf2stats WHERE match_id=’$match_idP’”);

I used it once, then I tried using it again didnt work

So I made another variable called $result4 with exactly same stuff
$result4=mysql_query(“SELECT * FROM bf2stats WHERE match_id=’$match_idP’”);

And it works. So my question is are you not allowed to use the same query variable more then once?

Depends on how you are using it and what the error is that you are getting.
Maybe if we seen the snippet of code we could be understand what is going on.

It’s okay to use mysql_query is much as you want, nest it in loops as deeply as you want, doesn’t matter. Just make sure that you don’t overwrite the $result (coz that’s what most pplz call their result resource) variable of a loop inside that loop.

Sponsor our Newsletter | Privacy Policy | Terms of Service