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.
精彩评论