How to repeatedly append and print the results of listing multiple select statements first: $ names = array ("Keyword 1", "keyword 2", "keyword 3 ");
Then select the keywords and print them out. The following program can only print the result of the last keyword 3. Please help solve the problem. O (∩) O thank you
For ($ I = 0; $ I $ Query = "SELECT * from te where title like \" $ names [$ I] \ "";
$ Result = @ mysql_query ($ query) or die ('query statement error: '. mysql_error ());
While (!! $ Row = mysql_fetch_array ($ result )){
Echo $ row ['id']. '----'. $ row ['title']. '----'. $ row ['URL'];
Echo'
';
}}
Reply to discussion (solution)
Are there no search results for the first two?
So what? Only keyword 3 has results.
Like has no wildcard, which is equal to the = sign. The data in your table does not contain title = keyword 1 or title = keyword 2 d.
Are there no search results for the first two? Yes. Only the matching results of search keyword 3 are printed. What if I want the results of all three keywords to be displayed? I suspect it is a while problem.
Like has no wildcard, which is equal to the = sign. The data in your table does not contain title = keyword 1 or title = keyword 2 d. Yes. Even if I customize three data arrays, only the matching results of the third data can be displayed. I want to list all three keywords.
So what? However, it is only the result of keyword 3. the moderator, I want to list all the results of the three keywords. Not just the matching results of 3rd keywords
I don't quite believe it. you can paste your table data and page output results into a graph.
First, let's clarify the difference between "include" and "equal ".
Use title like "% {$ names [$ I]} %"
Or INSTR (title, "{$ names [$ I]}")