Hi,
I have a search engine which searches some words in the database.If it finds something, it creates a list which has checkboxes. And, you check some boxes that you want, and if you want to search more, you clicks the button of "search more", so it adds their id's to a string and search another keyword, and it finds some other results. You choose some, again. After this operation, these chosen boxes's id's must be added to these string, too. But, it does not add them, for each search it makes zero the value of this string.
NOTE: This string is between <script>,</script> tags. Since, it must add the information after onClick operation
How I can solve this problem?
Using a string with concatenation
Moderator: General Moderators
-
mustafamisir
- Forum Newbie
- Posts: 23
- Joined: Wed Jun 22, 2005 1:00 pm
- Contact:
it's all in the way you set up your sql query
Code: Select all
// $string 1 should be a comma delimited list of ids
// $string 2 should be a comma delimited list of ids
$result = mysql_query("SELECT * FROM table WHERE id IN ($string1,$string2)");-
mustafamisir
- Forum Newbie
- Posts: 23
- Joined: Wed Jun 22, 2005 1:00 pm
- Contact:
-
mustafamisir
- Forum Newbie
- Posts: 23
- Joined: Wed Jun 22, 2005 1:00 pm
- Contact:
I have a seacrh page which searches some articles in the database. When you search one word, it gives many solution to you, and each of these solutions have one checkbox. And then you will checks these boxes which you want articles. It will store the ID's of these articles to a STRING. After this operation, maybe you will want to search more for another word. So, you will click the "SEARCH MORE" button. Then, it will sends the stored string to this new page, and you will search for another word. And again, it will give some results and you will check some of them. After that, these articles's ID's will be added to the STRING. As a result, you will click SHOW button, and it will show all of the ID's which you selected.
NOTE:These buttons have onClick characteristic with JavaScript. Also, these search engine has a page search.php and all the operations are occured on this page, and also this page includes some pages with include "...php"
NOTE:These buttons have onClick characteristic with JavaScript. Also, these search engine has a page search.php and all the operations are occured on this page, and also this page includes some pages with include "...php"