|
楼主 |
发表于 2014-12-11 11:55:59
|
显示全部楼层
求解阿!!还是CI可以做到底下直接呼叫function来用??
PHP复制代码 <?php
public function test02 ($id){
$str="SELECT name FROM test02 WHERE id=$id";
$result=mysql_query($str);
list($name)=mysql_fetch_row($result);
return $name
}
?>
<?php
$query = "SELECT * FROM test01 ";
$result = mysql_query($query) or die("cannot connect to table" . mysql_error( ));
while ( $row = mysql_fetch_array($result) ) {
{
echo test02 ($row1[$id]);
}
?>
复制代码
|
|