473,395 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how do i increment inside a loop?

initialize a var to 1 outside of your mysql_fetch_array() loop. Then, within the mysql_fetch_array() loop, use the var as necessary and increment it by 1
Aug 9 '06 #1
5 1917
iam_clint
1,208 Expert 1GB
you do it exactly as you said :P

var = 1
loop
var = var + 1
data
end loop
Aug 9 '06 #2
ronverdonk
4,258 Expert 4TB
Am I missing something here? What was the question?

Ronald :cool:
Aug 9 '06 #3
ok maybe not clear in what i wanted

i have this
$pos=1
where do i put the loop in this
($row = mysql_fetch_array($result, MYSQL_ASSOC))
Aug 9 '06 #4
iam_clint
1,208 Expert 1GB
$pos=1
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
$pos=$pos + 1
Aug 9 '06 #5
thank you iam_clint i had trouble putting it wher i wanted it at first then put it in the correct place in place of $row[$pos]

thank you again
Aug 9 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: john brown | last post by:
I'm new to perl programming and would like some help if at all possible. I'm trying to make a simple script where I can input a filename. To be exact something like "/home/song1.mp3". I want to...
11
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address...
8
by: Mantorok Redgormor | last post by:
The only adder I was able to come up with for incrementing by one, uses a for loop. I was trying to do this without using a for loop while emulating i++(it's for obfuscated code) Anyone know...
4
by: Noah | last post by:
Hi, I bet the question below has been answered many times before, but I have not found an answer. If someone could point me to one that would be great! I have the following table: num ...
6
by: Allan Stirrett | last post by:
Hi, I've got a section of code that basically goes like so: int l_Index = 0; std::set<intl_Set; while(l_Index < 10) { l_Set.insert(l_Index++); }
2
by: Nishu | last post by:
Hi All, My Aim here is to increment lArray whether control goes inside if statement or not. Is this a portable step and C guarantees that lArray must be incremented? Thanks, Nishu
5
by: per9000 | last post by:
Hi, today I experimented with the increment/++ operator. It seems the behavior depends on the compiler (I used cl/gcc + cs/mcs) and the language (I tested C and C#). Is the ++-operator well...
0
chumlyumly
by: chumlyumly | last post by:
Hello scripters - OS: Mac OSX Language: PHP w/ MySQL database I've created an insert page where a user inputs his info, which then goes to four different tables in a MySQL database. The...
2
by: agarwalsunitadhn | last post by:
Hello I have some problem in for loop. actually i want to write some procedures based on oracle and i have to increment 5 for each loop. i want to know is it possible to change the default...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.