Hello
I'm developing dictionary. I know how to search certain keyword if the keyword (full word) is correctly inserted. However I don't how to retrieve the if a part of the word is inserted.
As example, the code below will do if I insert 'Information Security', but not 'Security'.
Quote:
<?php
if(!$_POST["keyword"])
{
echo "Please insert keyword<br />";
}else{
$conn = db2_connect("xxx", "xxx", "xxx");
$query = 'SELECT * FROM XMLTABLE(
\'db2-fn:xmlcolumn("TERM.TERM")/term\'
COLUMNS
"TERM" VARCHAR (5000) PATH \'term\' ,
"DEFINITION" VARCHAR (5000) PATH \'definition\',
) AS T
Where term = ?
';
$stmt = db2_prepare($conn, $query);
$term = $_POST["keyword"];
if ($stmt) {
db2_bind_param($stmt, 1, "term", DB2_PARAM_IN);
db2_execute($stmt);
while($row = db2_fetch_object($stmt)){
printf("$row->TERM $row->DEFINITIONn");
}
}
db2_close($conn);
}
?>
|
I tried change '=' to 'like' but still no success.
Any suggestion will be helpful.
Thank You