Using a string with concatenation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mustafamisir
Forum Newbie
Posts: 23
Joined: Wed Jun 22, 2005 1:00 pm
Contact:

Using a string with concatenation

Post 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?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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)");
mustafamisir
Forum Newbie
Posts: 23
Joined: Wed Jun 22, 2005 1:00 pm
Contact:

Post by mustafamisir »

it must not be via database, it must be only in the code...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it'd help if we could see this code.. :?
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

It'd be helpful to understand how you want it done :)
mustafamisir
Forum Newbie
Posts: 23
Joined: Wed Jun 22, 2005 1:00 pm
Contact:

Post 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"
Post Reply