need help with while function

hello,

first sorry for my english

i want to convert my web from asp to php

in the asp web i have included con.asp page in the top of all my pages witch has the connection string and sql and ado and rs

and in each page i used functions like that

do while not rs1.eof = true …

to convert that in php i have to use this

while ($rs1 = mysql_fetch_array($results)) { …

but my problem is

this variable $results had different values and in the asp its declared in the included con.asp

but if i use that in php then the value in $results is not what i need

then i tried to use while(!$rs1->eof==true) and tried while(!$rs1->eof)

but that didn’t work

so i need any function that mean while($rs not eof) but don’t want use while ($rs1 = mysql_fetch_array($results)) { …

please help me

thank you

sorry I’ve read this post a few times but I don’t know what you mean can you try explaining it again?

okay

in asp

i put this in com.asp for all pages

sql = “select * from table1”
set rs = ado.execute(sql)

sql = “select * from table2”
set rs2 = ado.execute(sql)

sql = “select * from table3”
set rs3 = ado.execute(sql)

then use rs rs2 rs3 in all my pages like that

do while not rs.eof = true
etc etc …
rs.movenext
loop

to convert that to php i have to do that

sql = “select * from table1”
rs = mysql_fetch_array(sql)

sql = “select * from table2”
rs2 = mysql_fetch_array(sql)

sql = “select * from table3”
rs3 = mysql_fetch_array(sql)

then to use “while” in php i have to do that

while($rs = mysql_fetch_array(sql)) {
etc …
}

note that in asp i have different value for “sql” but the rs registered for each value

if i do that “while” in php i have to use fetch array for “sql” again

but the “sql” has different value now so i got error

the answer for this question is to use sql1 sql2 and sql3

then i can do fetch array for each sql

but my web has more than 150 asp page that use the old way

so my question

i want use “while” in php this way

while($rs <> eof) { … } something like that

i tried while(rs->eof) { … } but that didn’t work

do u have any solution ?

i hope now u can understand me

thank you

can you simply not pass the different varible each time like $rs, $rs1 ect

[php]while($rs = mysql_fetch_array($rs)) {
etc …
}

while($rs = mysql_fetch_array($rs1)) {
etc …
}

while($rs = mysql_fetch_array($rs2)) {
etc …
}[/php]

i tried that be4 but didn’t work

i can’t remember the error description but i remember its didn’t work

sorry i mean my problem with “sql” not with rs

see my question

Sponsor our Newsletter | Privacy Policy | Terms of Service