开发者

How do i properly format a Mysqli query result in PHP? And is there an equivalent to mysql_field_table() for mysqli?

So I am writing a small PHP framework for fun, and I have come to a point where I need to format an arbitrary query result into this format:

Array(<br>
[tablename]<br>
  [fieldname] => value<br>
  [fieldname] =&g开发者_如何学运维t; value<br>
[tablename]<br>
  [fieldname] => value);<br>
<br>

If I was doing this in mysql, I would simply do it this way: $tmp[mysql_field_table][mysql_field_name] = $value. But I chose to do this project using mysqli, and I can't seem to find an equivalent for mysql_field_table() so I can determine the table for each individual value. What is the ideal method for gaining this result?


Look at the example here in the manual; the return value of the function documented is an object with a member called 'table'.

This gives you what you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜