Mysql:如何基于WHERE查询多个? [英] Mysql: how querying multiple based on WHERE?

查看:200
本文介绍了Mysql:如何基于WHERE查询多个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试选择多个值,现在它只能获得1个基于ImageID的值,

如何我能让它返回多个值吗?我尝试添加我的$ Value2但它不起作用。



  $ Value1  =  1 ; 
$ Value2 = 2 ;
$ this-> db-> select( Link,Title);
$ this-> db-> from( imagelink_table);
$ this-> db-> where( ImageID ='$ Value1');
// $ this-> db-> where( ImageID ='$ Value2'< /跨度>);
$ query = $ this-> db-> get();



< br $> b $ b



提前谢谢。

解决方案

Value2但它不起作用。



  


Value1 = 1 ;


Value2 = 2 ;

Hi,

I'm trying to select multiple value, right now it only get 1 value based on ImageID,
how can I make it return multiple value? I tried adding my $Value2 but it doesnt work.

$Value1 = 1;
$Value2 = 2;
$this->db->select("Link,Title");
             $this->db->from("imagelink_table");
             $this->db->where("ImageID = '$Value1'");
             //$this->db->where("ImageID = '$Value2'");
             $query = $this->db->get();





Thanks in advance.

解决方案

Value2 but it doesnt work.


Value1 = 1;


Value2 = 2;


这篇关于Mysql:如何基于WHERE查询多个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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