Page 1 of 1

Using a string with concatenation

Posted: Mon Aug 01, 2005 7:12 am
by mustafamisir
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?

Posted: Mon Aug 01, 2005 8:03 am
by s.dot
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)");

Posted: Tue Aug 02, 2005 6:30 am
by mustafamisir
it must not be via database, it must be only in the code...

Posted: Tue Aug 02, 2005 7:07 am
by feyd
it'd help if we could see this code.. :?

Posted: Tue Aug 02, 2005 8:16 am
by theda
It'd be helpful to understand how you want it done :)

Posted: Wed Aug 03, 2005 7:32 am
by mustafamisir
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"