将mys从mysql查询中放入数组 [英] put ids into array from mysql query

查看:55
本文介绍了将mys从mysql查询中放入数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好 -


我试图从另一个查询页面上显示的ID中提取此查询。


它运行但它限制结果集只返回一条记录而不是2条用于查询。


第一个查询可以有很多id'和第二个查询可以有很多第一个。


我可以获得id的唯一方法是将一个变量分配给发布的id记录集。 />

我的主要目标是在第一个查询中从id'创建一个数组来拉取第二个查询的数据。


你能提供一个存储一组id并在第二次qry中访问它们的例子吗?我用Google搜索了,但发现一些类似的东西没用。


i会发布代码,但限制为20行。


提前感谢你的帮助!

hello -

i''m trying to pull this query from the ids that are displayed on the page from another query.

it runs but it limits the result sets only returning one record instead of 2 that are for the query.

the first query can have many id''s and the 2nd query can have many to the first.

the only way i can get the id is from assigning a variable to the posted id record set.

my main objective is to create an array from the id''s in the first query to pull the data for the second query.

could u provide an example of storing an array of ids and accessing them for the 2nd qry? i''ve googled, but found some similar nothing useful.

i would post code but limit is 20 lines.

thanks in advance for your help!

推荐答案

不确定我是否理解正确,但这里有一些(希望)有用的链接:
PDO - fetchAll()
MySQLi - fetch_all()
not sure if I understood it correctly, but here are some (hopefully) helpful links:
PDO - fetchAll()
MySQLi - fetch_all()


会很棒如果你可以举例说明你的需求是什么。
would be great if you can exemplify what exactly your need is.


感谢您的回复。


ok这是我想要完成的事情。
thanks for your response.

ok here is a moch of what im trying to accomplish.
< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


这篇关于将mys从mysql查询中放入数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆