Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Contests > PHP Programming Contests

PHP Programming Contests Everything to do with the PHP Programming Contests.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2005-11-15, 11:10 AM
Junior Member
 
Join Date: Nov 2005
Posts: 2
rramya2k
Default

Hello,

This is the code which I have written


<?php
// ******************* Results are shown according to the keywords selected **********************
if ($HTTP_POST_VARS['select_paper1']=='Keywords')
{
require("the_jewel.php");
$uniquetitles = array();
if ($HTTP_POST_VARS['results'] =='differences')
{
$j=0;
$sql = "SELECT paper_exp_mod_con_id
FROM schmitzs.paper_exp_mod_poe_con
WHERE paper_exp_mod_poe_con_id in (SELECT paper_exp_mod_poe_con_id
FROM schmitzs.statistics
WHERE sign_level <> 'n.s.'
GROUP BY paper_exp_mod_poe_con_id)
GROUP BY paper_exp_mod_con_id";
$stmt = OCIParse($conn, $sql);
OCIExecute($stmt);
while ($temp = OCIFetch($stmt)) //reads row by row
{
$paper_exp_mod_con_id = OCIResult($stmt, "PAPER_EXP_MOD_CON_ID");
$sql2 = "SELECT m_rid
FROM schmitzs.paper_exp_mod_con
WHERE paper_exp_mod_con_id = ".$paper_exp_mod_con_id."
GROUP BY m_rid";
$stmt2 = OCIParse($conn, $sql2);
OCIExecute($stmt2);
while ($temp = OCIFetch($stmt2)) //reads row by row
{
$m_rid = OCIResult($stmt2, "M_RID");
$sql3 = "SELECT p_title
FROM schmitzs.paper_details
WHERE m_rid = '$m_rid'
GROUP BY p_title";
$stmt3 = OCIParse($conn, $sql3);
OCIExecute($stmt3);
while ($temp = OCIFetch($stmt3)) //reads row by row
{
$p_title = OCIResult($stmt3, "P_TITLE");
echo "$p_title";
echo"
";

}
}

}
}
}
?>


the result out of it is

*** differences in the functional organization of the brain for language
Language processing is strongly left lateralized in both sexes. Evidence from functional MRI
*** differences in lateralization revealed in the posterior language areas
*** differences in semantic language processing: A functional MRI Study
*** differences in semantic language processing: A functional MRI Study

Temporal lobe activation demonstrates *** based differences during passive listening


here the purple coloured results should appear only once. But it appears twice. Can anyone help me in this regard so that I get only one time and not repeated results.

the problem of the database structure here is:-

only the records with paper_exp_mod_con_id from paper_exp_mod_poe_con table with the paper_exp_mod_poe_con_ids coming from statistics table which has sign_level not equal to 'n.s.' should be returned and the result here is

SQL:-

SELECT paper_exp_mod_con_id FROM schmitzs.paper_exp_mod_poe_con
WHERE paper_exp_mod_poe_con_id in (SELECT paper_exp_mod_poe_con_id FROM schmitzs.statistics WHERE sign_level <> 'n.s.' GROUP BY paper_exp_mod_poe_con_id) GROUP BY paper_exp_mod_con_id";


RESULT:-

PAPER_EXP_MOD_CON_ID
---------------------------------
1
3
4
5
6
7


then this id is passed to the paper_exp_mod_con table to get the m_rid one by one and the result obtained here is:-

SQL:-


SELECT m_rid FROM schmitzs.paper_exp_mod_con WHERE paper_exp_mod_con_id = ".$paper_exp_mod_con_id."";

RESULT:-

PAPER_EXP_MOD_CON_ID M-RID
--------------------------------- --------
1 3
3 4
4 20
5 25
6 25
7 26



so the problem here is m_rid with 25 is returned twice but only once I need it.

Help me in this regard.

Ramya

Thanks
Ramya
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:08 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.