Re: Help with mysql rowpointer

From: Date: Wed, 22 Aug 2001 14:50:35 +0000
Subject: Re: Help with mysql rowpointer
Groups: php.windows 
Request: Send a blank email to php-windows+get-9002@lists.php.net to get a copy of this message
Lars, I'm not quite sure I understand why mysql_num_rows($result) would not work for you. You said that function would only tell you how many records that came from your query, but aren't the records that came from your query the only ones you want to count? So if you get 4 records from your query that need to be printed out to the page then doing num_rows on it will give you 4. Then you can say, ok..if number of rows equals 4, then do this, else print that. I must be misunderstanding what you want to do..sorry :( Angie >>> Lars Eirik Rønning <lars.ronning@ifi.uib.no> 08/22/01 05:17AM >>> Hey there. I realize this is a forum for php-windows users,but knowing that most of you guys run a mysql db as backend i have a question for you.. I know there is a way to return the amount of records in the db by using the mysql_num_rows($resultid). My problem is that it only returns the total number of records from my query I have seen that there is a function called mysql_data_seel(par,par), but i am not sure how it works. My problem is the following> i want to do a print out of each record in the db , but the HTML code (to be exact the positioning of the HTML table should be different depending on the number of record printed out. To illustrate this is more or less what i want > i want to print out record 1 in one style , then i want to next record to be printed out in a different way. Is there a way to do a check on which number of record is printed out. I realize i cannot use the id simply because if i do a printout of total 4 records and i want to use a record with id = 100 e.g then it won't do me any good. Basically is there a way for me to check the number of record is printed out on a page. If i want to print out 4 records then the first row should be 1..Regardless of the ID stored in the db. I hope you understand me .if now i would be happy to reply with a more detailed instruction on my problem. in ODBC db i know one can use the rs.next object and method, but is there an equivalent to this in MYSQL.. Thanks everyone Lars Eirik -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#9002) next »