List:General Discussion« Previous MessageNext Message »
From:Miguel Cardenas Date:September 17 2005 8:08pm
Subject:mysql_free_result() WITHOUT mysql_fetch_row()
View as plain text  
Hello list

I have a technical doubt, very simple but not mentioned in the manual...

What happens if I call mysql_free_result() after performing a query but 
without doing mysql_fetch_row() ???

It may sound strange, but just need to know if a data row exists more than the 
data itself...

The right algorithm should be:

   1. send a query: select something from table1
   2. get the results: mysql_use_result() or mysql_store_result()
   3. if results available mysql_fetch_row()
   4. free the resources: mysql_free__result()

but in fact I don't require step 3, only need something like this:

   1. send a query: select something from table1
   2. get the results: mysql_use_result() or mysql_store_result()
   3. if results available CONDITION=TRUE else CONDITION=FALSE
   4. free the resources: mysql_free__result()

   5. if CONDITION=TRUE then ...

so... is there any problem if I free the resources before reading all of them?

Thanks!!!

Thread
mysql_free_result() WITHOUT mysql_fetch_row()Miguel Cardenas17 Sep
  • Re: mysql_free_result() WITHOUT mysql_fetch_row()Dan Nelson17 Sep
    • Re: mysql_free_result() WITHOUT mysql_fetch_row()Miguel Cardenas18 Sep
      • Re: mysql_free_result() WITHOUT mysql_fetch_row()Pooly18 Sep
        • Re: mysql_free_result() WITHOUT mysql_fetch_row()Miguel Cardenas18 Sep
          • Re: mysql_free_result() WITHOUT mysql_fetch_row()Pooly19 Sep
Re: mysql_free_result() WITHOUT mysql_fetch_row()Pooly19 Sep
  • Re: mysql_free_result() WITHOUT mysql_fetch_row()Miguel Cardenas19 Sep
    • Re: mysql_free_result() WITHOUT mysql_fetch_row()SGreen19 Sep