hello! i have a problem here will you please help me?.. this is my script
[PHP]
<?php
//$text = "Like '%american journal of med%'";
$text = $_POST["box"];
$sep = " ";
$out = strtok($text, $sep);
$output = " TI Like '%$out%' ";
$sql ="SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE ".$output;
echo $sql;
while ($out !== false)
{
$out = strtok(" ");
if ($out ==false) {
echo "AND";
}
}
function db_connect_ctlg ()
{
$conn = odbc_connect("s ys_foresta_ctlg ", "sa", "");
if(!$conn)
{
// x借yP失z・写rf r(qz
return NULL;
}
else
{
return $conn;
}
}
function ExecInforestaQu ery($query){
$Set=db_connect _ctlg();
if (!$Set)
{
echo "Connect Failer!!<BR>";
return NULL;
}
else
{
$query_result = odbc_exec($Set, $query);
if (!$Set)
{
echo "Query Failer!!<BR>";
return NULL;
}
else
{
return $query_result;
}
}
}
$XResult=ExecIn forestaQuery($s ql);
$x=0;
while($rec = odbc_fetch_arra y($XResult)){
$title=$rec['TI'];
$y=0;
$Count=0;
while($x>$y){
if ($a[$y][0]==$title){
$a[$y][1]=$a[$y][1]+1;
$Count=1;
}
$y=$y+1;
}
if ($Count==0){
$a[$x][0]=$title;
$a[$x][1]=1;
$x=$x+1;
}
}
$X=0;
while($X<$x){
//echo $a[$X][0]." </BR> ";
$X=$X+1;
}
odbc_free_resul t($XResult);
?>
[/PHP]
and i want this output..
- output -
SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE TI Like '%new%' AND Like '%eng%' AND Like '%jour%'
if i'm going to put the new eng jour at textbox.. the textbox output appear after the SELECT output..
please help me.. tnx!
[PHP]
<?php
//$text = "Like '%american journal of med%'";
$text = $_POST["box"];
$sep = " ";
$out = strtok($text, $sep);
$output = " TI Like '%$out%' ";
$sql ="SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE ".$output;
echo $sql;
while ($out !== false)
{
$out = strtok(" ");
if ($out ==false) {
echo "AND";
}
}
function db_connect_ctlg ()
{
$conn = odbc_connect("s ys_foresta_ctlg ", "sa", "");
if(!$conn)
{
// x借yP失z・写rf r(qz
return NULL;
}
else
{
return $conn;
}
}
function ExecInforestaQu ery($query){
$Set=db_connect _ctlg();
if (!$Set)
{
echo "Connect Failer!!<BR>";
return NULL;
}
else
{
$query_result = odbc_exec($Set, $query);
if (!$Set)
{
echo "Query Failer!!<BR>";
return NULL;
}
else
{
return $query_result;
}
}
}
$XResult=ExecIn forestaQuery($s ql);
$x=0;
while($rec = odbc_fetch_arra y($XResult)){
$title=$rec['TI'];
$y=0;
$Count=0;
while($x>$y){
if ($a[$y][0]==$title){
$a[$y][1]=$a[$y][1]+1;
$Count=1;
}
$y=$y+1;
}
if ($Count==0){
$a[$x][0]=$title;
$a[$x][1]=1;
$x=$x+1;
}
}
$X=0;
while($X<$x){
//echo $a[$X][0]." </BR> ";
$X=$X+1;
}
odbc_free_resul t($XResult);
?>
[/PHP]
and i want this output..
- output -
SELECT MSNEW.ID , MSNEW.UI , MSNEW.GID , MSNEW.IID , MSNEW.TI , MSNEW.TIYOMI , MSNEW.ORGYOMI , MSNEW.CY , MSNEW.PU , MSNEW.YR, MSNEW.ISSN, MSNEW.ACRONYM, MSNEW.ABBREVIAT ION, MSNEW.NOTE, MSNEW.VTI, MSNEW.VTI2, MSNEW.VTI3 FROM MSNEW WHERE TI Like '%new%' AND Like '%eng%' AND Like '%jour%'
if i'm going to put the new eng jour at textbox.. the textbox output appear after the SELECT output..
please help me.. tnx!
Comment