在PHP / oracle中需要一些帮助 [英] Need some help in PHP/oracle

查看:67
本文介绍了在PHP / oracle中需要一些帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我需要以下代码的帮助 -



我有2张桌子 - A和B



A | B

====================

1 | 1

2 | 2

3 | 3



我需要的是表A中的行(1)应该被允许与tableB中的行(2)和行(3)合并,同样是tableA行(2)应该允许与tableB的row(1)和row(3)合并,tableA row(3)应该允许与tableB的row(1)和row(2)合并。

[这只是一个例子]



我尝试过:



我试图使用



$ array = array('1 => 1','2 => 2','3 =>' );

$ query =从表中选择A,其中B ='。$ T。'联合所有从表中选择B,其中A ='。$ T。';

$ stid = oci_parse($ conn,$ query);

$ row = oci_execute($ stid);

$ row = oci_fetch_row($ stid );

$ oci_free_statement($ stid);



我无法确定是否需要使用切片/交叉/子集。

我一直在尝试使用OCI_bind_by_array对此进行排序,但是没有去,我花了3天但无法找到解决方案。

Hi everyone,

I need help with the below code -

I have 2 tables - A and B

A | B
====================
1 | 1
2 | 2
3 | 3

All i need is the row(1) from table A should be allowed to merge with row(2) and row(3) in tableB, likewise tableA row(2) should be allowed to merge with row(1) and row(3) of tableB and tableA row(3) should be allowed to merge with row(1) and row(2) of tableB.
[this is just an example]

What I have tried:

I tried to use

$array = array('1=>1','2=>2','3=>');
$query ="select A from table where B='".$T."' union all select B from table where A='".$T."'";
$stid = oci_parse($conn,$query);
$row = oci_execute($stid);
$row = oci_fetch_row($stid);
$oci_free_statement($stid);

I am not able to sure if we need to use slice/intersect/subset.
I have been trying to sort this using OCI_bind_by_array as well but no go, i have spent 3days but unable to find a solution.

推荐答案

array = array('1 => 1','2 => 2','3 =>');
array = array('1=>1','2=>2','3=>');


query =从表中选择A,其中B ='。
query ="select A from table where B='".


T。'union all选择表格中的A,其中A ='。
T."' union all select B from table where A='".


这篇关于在PHP / oracle中需要一些帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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