How to Use LOOP to get All the data from tables
Posted: Wed Mar 04, 2009 7:00 am
I dont know whether I am being completely stupid or what, but I cant seem to pick out all the records from my database.
The overall problem is:
I have a table with n amount of rows, and would like to pull all these rows out and store them in an array in php.
What I have so far is:
myquery=SELECT * FROM Table1;
result=mysql_fetch_array(myquery){
$skill1=$row['skill1']
$skill2=$row['skill2']
.....
this will store skill1 and skill2, but what if i have n skills? I have tried using the loop but im not sure if i did it correctly because I still had to state the variables in my array. If i have 8 variables, 8 skills will show and so on.
Can anyone help?
The overall problem is:
I have a table with n amount of rows, and would like to pull all these rows out and store them in an array in php.
What I have so far is:
myquery=SELECT * FROM Table1;
result=mysql_fetch_array(myquery){
$skill1=$row['skill1']
$skill2=$row['skill2']
.....
this will store skill1 and skill2, but what if i have n skills? I have tried using the loop but im not sure if i did it correctly because I still had to state the variables in my array. If i have 8 variables, 8 skills will show and so on.
Can anyone help?