I want to make a page that spits out a range of data, all from different rows in the table, but I cant seem to figure out how I go about running multiple queries, with the exception of naming things like $field1row1, $field2row1, $field1row2 etc., but that kind of limits me to a set number of rows in the table, where I need it to be dynamic.
Is there an easy way to pass the data accross and have it run multiple queries?
Example:
Row 1 values - 2 1
Row 2 values - 3 2
send to page with query, and I do
update table set field1='2',field2='1' where whatever determines row 1
update table set field1='3',field2='2' where whatever determines row 2
Thanks for any help.
multiple row form
Moderator: General Moderators
Re: multiple row form
I'm a bit of a beginner at php myself, but I think I understand what you want to do
I guess first, get a count of how many rows you have, then do a while loop through, reading all the values within each row, and recording them into an array. I'd guess after that you'd want to spit these values out into forms, so you'd be able to update numerous rows at the same time - am I correct here?
I guess first, get a count of how many rows you have, then do a while loop through, reading all the values within each row, and recording them into an array. I'd guess after that you'd want to spit these values out into forms, so you'd be able to update numerous rows at the same time - am I correct here?
Re: multiple row form
I don't really understand what you want to do. Can you be more specific? Instead of generalities such as "a range of data", show us what kind of data is in your table(s) and what you want it to look like when it is displayed.fugaki wrote:I want to make a page that spits out a range of data, all from different rows in the table, but I cant seem to figure out how I go about running multiple queries, with the exception of naming things like $field1row1, $field2row1, $field1row2 etc., but that kind of limits me to a set number of rows in the table, where I need it to be dynamic.
Is there an easy way to pass the data accross and have it run multiple queries?
Example:
Row 1 values - 2 1
Row 2 values - 3 2
send to page with query, and I do
update table set field1='2',field2='1' where whatever determines row 1
update table set field1='3',field2='2' where whatever determines row 2
Thanks for any help.