newbie's question
Posted: Mon Feb 26, 2007 12:42 pm
Is there a way to combine two variable names? I would like to have $sql1,$sql2 .... assign to different string by using single FOR statement. please see the following code. I know "$sql.$i" is wrong, then how do i put $i into the variable $sql? another way? sorry for the dumb question.....
Code: Select all
<?php
for ($i=0;$i<5;$i++) {
$sql.$i = "select * from temp where col = '".$i."'";
.................
}