Jump to content

xbl1

Members
  • Posts

    214
  • Joined

  • Last visited

Everything posted by xbl1

  1. xbl1

    ask adivice

    Hello;i'd like to you some ideas plaese.i got a table in database, and their structure as following;table name: BookCid Topic Content1 ss ss2 ss ssI want to display all the topic from the database into a table. if i click on a topic, then i can known the correspondence's Cid, and base on that, i willdisplay the correspondence Content.And the table should like the link has http://java.sun.com/docs/books/tutorial/ui...ents/table.htmlThe problem for me, in website, what kind of knowledge can help me to has a table like i say?
  2. Thanks, that's what i want.
  3. Hello; i want to have a textarea box come out with value which it can be edited by user.but my code could not do it, could you tell why? <form><TEXTAREA name="content" clos=50 rows=10 value="i want have some sentence here for edit" onkeyup="this.value = this.value.slice(0, 200)"></TEXTAREA></textarea></form>
  4. Thanks a lot, it is nice code, i like it
  5. i want to ask you again, why i could not print out the value. in the deleteR.php $arrdelete = $_REQUEST['id_delete']; if(is_array($arrdelete)){ $arrdelete = $_REQUEST['id_delete']; $numId=count($arrdelete); echo $numId; // i can get this value echo "<br>"; echo $arrdelete['$num']; // but i could not get this value }
  6. Thanks for your help, it does work now.
  7. Hello; i want to let user delete their data from database. Note: one user may have more than one rows of data.table as following;TCid UserName Topic Content1 q1 xx xxx2 q2 xx xxx3 q3 xx xxx4 q1 xx xxx5 q2 xx xxxAnd i code as following steps;1) ask user input user name2) Display out all the data which the users got. (it is in delete.php file.)in here, i will use the check box, to let the user choices which data they will delete.note: i will try to make the Cid relate with the input name, so later on i can deletethe data base on Cid.3) i will delete the data base on the user choice(it is in deleteR.php file).but at the movement, i just want to test where i can get the value of the TCid or not(because i will delete some datas base on the TCid which the user choiced).The problem i go now, it is from the step 3, i could not get the TCid's value out,that's mean, i could not delete some data base on the user choiced.input user name (step 1) <html><body><form action='delete.php' method="POST">Please eneter your userName:<input type="text" name="userName" value=0><br><input type="submit" value="submit"><input type="reset" value="reset"></form></body></html> delete.php (step 2) <html><body><form action='deleteR.php' method="POST"><? $con = mysql_connect("localhost", "xxxxx","xxxxx"); if (! $con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxx", $con); $result = mysql_query("select * from Customer2 where UserName='$_POST[userName]'");$CArray = array(); $i=0;while($row = mysql_fetch_array($result)){ $CArray['$i']=$row['TCid']; ?><input type="checkbox" name=" <? $CArray['$i'] ?> " ><? echo $row['Topic']; $i++;?><br><?}?><input type="submit" value="submit"><input type="reset" value="reset"></form></body></html> deleteR.php (step 3) <?$i=0;while(isset($_POST['$CArray[$i]'])){ echo "The customer will delete their data from the TCid= "; echo $CArray[$i]; echo "<br>"; $i++; }?>
  8. Hello; I want to print out some value when a user click on a check box. But my code does not works, could you tell why, thanks. <html><body><form action='deleteR.php' method="POST"><input type="checkbox" name="bike">i have a bike. <br><input type="checkbox" name="car">I have a car.<br><input type="submitD" value="submit"><input type="reset" value="reset"></form></body></html> in the deleteR.php file <?if($_POST['bike']!=null) echo "This is bike ";echo "<br>";if($_POST['car']!=null) echo " This is car.";?>
  9. Hello; I tried to print out some value which from a submit form, but i could not, could you tell me why, please. <html><body> <ceneter> <form action="submitR.php" method="post"> User Name: <input type="text" name="UserName" maxlength=2><br> Topic: <input type="text" name="Topic" maxlength=2> <br> Content:<br> <TEXTAREA name="content" clos=50 rows=10 onkeyup="this.value = this.value.slice(0, 200)"></TEXTAREA> <br> <INPUT type="submit" value="submit"> <INPUT type="reset"> </form> </ceneter> </body></html> in the submitR.php file<?echo "$REQUEST_['topic']";echo "$REQUEST_['content']";echo "$REQUEST_['username']";?>
  10. So nice the buttons you maked. i envy your job.Thanks for your time.
  11. Hello; I'd like to ask you how to make a bar like youtubewww.youtube.com, which it is under the 4 buttons(Video, Categories, Channels and Comnunity). <html><body><center><form><input type="button" name="Video" Value="Video"><input type="button" name="Categories" Value="Categories"><input type="button" name="Channels" Value="Channels"><input type="button" name="Community" Value="Comnunity"></form> </center></body></html>
  12. Thanks a lot, it works alrady.
  13. I have changeed like you say, it move to the cenetr of the page already. But i want to move it to top further more, i tried margin:1%, but it does not work. Do you have any idea for that?<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> table.display{margin:auto;} </style></head>
  14. Hello; Could anyone tell me how to addjust my result to the top(10% away from the top)? please.I try to use margin-top:10%, but it does not work. Please go to my website www.businessfind101.com, and type the sentence with "MySql YourSql" into search function, you will see the result in the button, i have not idea to move them up.and my code as following; php session_start(); $aString=$_REQUEST["SText"]; $_SESSION["aString"]=$aString; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css">[b] table.display{margin-top:10%}[/b] </style><body> <?php $con = mysql_connect("localhost", "#*$!","1#*$!"); if (! $con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("#*$!x", $con); $result = mysql_query("select * from Customer2"); // was it a success if (!$result) die ("Error processing request - check your query"); // process results $nrecs = mysql_num_rows($result); /* Use tab and newline as tokenizing characters as well */ $tok = strtok($aString, " "); while ($tok!== false) { $len=strlen($tok); $len=$len/2+1; $tok=substr($tok,0,$len); $b="tu"; $myresult=mysql_query("SELECT * FROM Customer2 WHERE MATCH (Topic,Des) AGAINST ('$tok*' IN BOOLEAN MODE);"); while($row=mysql_fetch_array($myresult)){ echo "<br>"; echo "<br>"; echo " "; $Cid=$row['Cid']; echo " "; $row['Count']=$row['Count']+1; $Count=$row['Count']; mysql_query("update Customer2 set Count='$Count' where Cid='$Cid'"); } $tok = strtok(" "); } $result = mysql_query("select * from Customer2"); echo "<table border=0 width=50% [b]class='display'[/b] bgcolor='ccffff'>";//[b]i will display result on the screen [/b] while ($row=mysql_fetch_array($result)){ if($row['Count'] >0){ echo "<tr><td>"; echo $row['Des']; echo "</td><td>"; echo $row['Count']; echo "</td> </tr>"; } } $f=0; mysql_query("update Customer2 set Count='$f'"); echo "</table>"; mysql_close($con);?> </body></html>
  15. xbl1

    FullText Search

    Thanks a lot, i undersstand it now.
  16. xbl1

    FullText Search

    I run the following sql statement, but it does not return result.SELECT * FROM Customer WHERE MATCH (Topic,Des) AGAINST ('man' IN BOOLEAN MODE);orSELECT * FROM Customer WHERE MATCH (Topic,Des) AGAINST ('job' IN BOOLEAN MODE);
  17. xbl1

    FullText Search

    Could anyone known why the fulltext search just can find some words but not all of the words, For instance the following words, it could not find;man, job, in for, when etc
  18. Can it mixup with "with Query Expansion'"?
  19. But this is not what i want.i want the solution of the full text search to deal with the following case.Example. Say I search for 'print', I would get results returned when words such as 'printers, printing, prints etc' are found.Could any one known this solution in here?
  20. i am not sure about that, but i found it is more efficient by using Match against.
  21. Hello;I am trying to do the full text search from mysql database to slove the following problem.1)for example could be searching for books by Georges Simenon about Maigret, when a user is not sure how to spell “Maigret”.2) another example, a user searching for “database” may really mean that “MySQL”, “Oracle”, “DB2”, and “RDBMS” all are phrases that should match “databases” and should be returned, too. or just solve the first problem.Someone introduce me the "with Query Expansion';but i found this interesting feature could be dangerous. It' s very simple to increase the number of matching rows close to the total number of rows of the table; such a search have no meaningCould anyone help, please.
  22. Thanks a lot, that's very good material.But the problem i got from that, the "Full-Text Searches with Query Expansion" does not work, For instance;mysql> SELECT * FROM articles -> WHERE MATCH (title,body) -> AGAINST ('database' WITH QUERY EXPANSION);It should come out with the following result,This example from select from table, and Create a table and insert value to the table.+----+-------------------+------------------------------------------+| id | title | body |+----+-------------------+------------------------------------------+| 1 | MySQL Tutorial | DBMS stands for DataBase ... || 5 | MySQL vs. YourSQL | In the following database comparison ... || 3 | Optimizing MySQL | In this tutorial we will show ... |+----+-------------------+------------------------------------------+but it give me the result as following;+----+-------------------+------------------------------------------+| id | title | body |+----+-------------------+------------------------------------------+| 5 | MySQL vs. YourSQL | In the following database comparison ... || 1 | MySQL Tutorial | DBMS stands for DataBase ... |+----+-------------------+------------------------------------------+And also example searching for books by Georges Simenon about Maigret, when a user is not sure how to spell “Maigret”. It does not work too.Could you tell why? Is the WITH QUERY EXPANSION old stuff ?
  23. hello;I am trying to implement a search function. But the problem i found my method is not good, just roughly to find out the result. for example, when i type a string with the "a man', it will fail here to find match.Could any one help to impove it, thanks. you can click the My Webpage to see my search function.There are 5 sentence in database. and i will compaire the input text with these 5 sentences one by one, and see which one match more, then list then out by decrease order with how many time they match.and the 5 sentences are 1) i am looking for a girl2) i want a job3) want want4) want ' job 5) i want a manfor instance;input text is want, and it compair with the sentence 3 of 'want want'.then i say here has one match, if i find one match, i will stop to compair. <?php session_start(); $st=$_REQUEST["SText"]; $_SESSION["st"]=$st; ?></head><body> <br>There are 5 sentence in database. and i will compaire the input text with these 5 sentences one by one, and see which one match more, then list then out by decrease order and with the number of match.<br><br><br> and the 5 sentences are <br>1) i am looking for a girl2) i want a job3) want want4) want ' job 5) i want a man<br><br> <?php $con = mysql_connect("localhost", "xxxx","xxxxx"); if (! $con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxxx", $con); $result = mysql_query("select * from Customer2"); // was it a success if (!$result) die ("Error processing request - check your query"); $f=0; // process results $nrecs = mysql_num_rows($result); // echo "<table border=0 width=50% class='id1' bgcolor='ccffff'>"; while($row = mysql_fetch_array($result)) { echo "<br>"; echo $row['Des']; $Des=$row['Des']; /* Use tab and newline as tokenizing characters as well */ $tok = strtok($st, " "); while ($tok !== false) { echo "<br>"; echo "$tok"; echo "<br>"; $len=strlen($tok); $C=$tok; if($len>2){ $len=$len/2+1; $C=substr($tok,0,$len); } // the "i" after the pattern delimiter indicates a case-insensitive search if (preg_match("/$C/i", $Des)) { $f++; $Des=preg_replace("/$C/i", "", $Des); echo "$C match <b>"; } else echo "$C don't match"; $tok = strtok(" "); } echo "<br>"; if($f>0){ mysql_query("update Customer2 set Count=" . "'$f'" . "where Cid=" . $row['Cid']); } $f=0; } // echo "</table>"; $result = mysql_query("select * from Customer2 order by Count DESC"); echo "<table border=0 width=50% class='id1' bgcolor='ccffff'>"; while($row = mysql_fetch_array($result)) { if($row['Count'] >0){ echo "<tr> <td width=10%>"; echo $row['Count']; echo "</td><td >"; echo $row['Des']; echo "<hr>"; echo "</td></tr>"; } } echo "</table>"; $f=0; mysql_query("update Customer2 set Count=" . "'$f'");mysql_close($con);?> </body></html>
×
×
  • Create New...