$rows["name"], 'description' =>$rows["title"], 'picUrl' => $rows["image_src"],"/> $rows["name"], 'description' =>$rows["title"], 'picUrl' => $rows["image_src"],">
Home > Backend Development > PHP Tutorial > 调用数据库并循环,该如何解决

调用数据库并循环,该如何解决

WBOY
Release: 2016-06-13 11:54:00
Original
873 people have browsed it

调用数据库并循环

case "tw":<br />								<br />			$record[0]=array(<br />				'title' =>$rows["name"],<br />				'description' =>$rows["title"],<br />				'picUrl' => $rows["image_src"],<br />				'url' => $rows["url"]<br />			);<br />			$resultStr = _response_multiNews($postObj,$record);<br />			  break;
Copy after login


假设 abc 是以上内容 链接数据库 现在需要循环abc 但abc里$record[0]=array(...)也要循环
$record[0]=array(...)可能只出现一次(一次的话我是可以的)但$record[0]=array(...)可能出现多次 像这样$record[0]=array(...)$record[1]=array(...)$record[2]=array(...)这样的话要怎么办? 想不通了....
------解决方案--------------------
            $record[]=array(<br />                'title' =>$rows["name"],<br />                'description' =>$rows["title"],<br />                'picUrl' => $rows["image_src"],<br />                'url' => $rows["url"]<br />            );<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template