1
neda_barna
get data from textbox
  • 2007/9/22 8:36

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


hi all
i have 1 textbox and 1 button in my form
now,i want search that get a word from textbox and search the word that exist in database or no
now i want know
how can get a word from database
yhis is my code but it dosent work
$word=$_POST['word'];
$query "SELECT * FROM ".$xoopsDB->prefix("tb1")." WHERE word LIKE '$word'" ;

please tell me how must write this code

2
script_fu
Re: get data from textbox

I will second that. Please do tell...

3
neda_barna
Re: get data from textbox
  • 2007/9/22 9:57

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


what????????????
i dont underestand what you said!!!!!

4
script_fu
Re: get data from textbox

I would like the answer to this as well.

Maybe your answer is here...

http://www.kaotik.biz/tutorial/buildmodule1.html

5
neda_barna
Re: get data from textbox
  • 2007/9/22 10:44

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


i read this document
but dont solve my problem
my code is:
 include_once ( "header.php" );
 include_once ( 
XOOPS_ROOT_PATH."/class/xoopsformloader.php" );



 include 
XOOPS_ROOT_PATH.'/header.php';


    
$form '

    
     '
._DIC_SEARCH.': 

    '
;
  
//dokme ra be vasat safhe mibare
 // $form.=    '  ';
    
$form .=    ' ._DIC_BUTTON_GO.'" />


        
                '
;

    
$caption '

            

        
'._DIC_MEAN.
'
;

    
$list '

    

    .$case.'&order=sid&order_pre='.$order.'&start='.$start.'

        &query_pre='
.$word.'&op='.$op.'">'._DIC_WORD.'

    .$case.'&order=title&order_pre='.$order.'&start='.$start.'

            &query_pre='
.$meaning.'&op='.$op.'">'._DIC_MEANING.'

    .$case.'&order=author&order_pre='.$order.'&start='.$start.'

            &query_pre='
.$example.'&op='.$op.'">'._DIC_EXAMPLE.'      

    

    
';
echo 
$form;
echo 
$caption;
$word=$_POST['word'];
$query "SELECT * FROM ".$xoopsDB->prefix("tb1")." WHERE word LIKE '$word'" ;
//$query. = tb1.idE = tb3.idE";

while($myrow $xoopsDB->fetchArray($query) )

{

$word $myrow['word'];

//$meaning = $myrow['meaning'];

//$example = $myrow['example'];



$list.= ''.$word.'';

}

$list.= '
'
;

echo 
$list;
$res=$xoopsDB->query($query);
//echo $res;

//$key = get_http_var( 'key' );
//$key = $this->getVar( 'key' );

//$query = "( word LIKE '%$key%'  )";

                       


include XOOPS_ROOT_PATH.'/footer.php';
?>

please read my code
do you think waht is it my problem
i think it is from this line
$word=$_POST['word'];

please tell me is it my problem

6
neda_barna
Re: get data from textbox
  • 2007/9/23 6:38

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


???????

7
Dave_L
Re: get data from textbox
  • 2007/9/23 9:42

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


$myts  =& MyTextSanitizer::getInstance();
$word  =  $myts->addSlashes($_POST['word']);
$table =  $xoopsDB->prefix('tb1');
$query =  "SELECT * FROM `$table` WHERE `word` LIKE '%{$word}%'";

Login

Who's Online

328 user(s) are online (228 user(s) are browsing Support Forums)


Members: 0


Guests: 328


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits