Hey guys I have an assigned array from mysql results and I simply want to number them starting at one. Does anyone know how to do this?
while ($row=mysql_fetch_assoc($query)){
$out[] = array("ASSIGNED INTEGER", $row['total']);
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll have to use a variable as a counter, to keep track of the line you’re on :
Or, if you want your resulting
$outarray have results indexed from1, instead of0, you could use something like this to set the index yourself :Or any idea derived from this.