Show all data in one string ?
Posted: Fri Oct 27, 2006 3:49 am
I currently have my code (php) looking at the searches listed in my database which are in a field called SEARCHES (Fields: sid, searchterm), now i'm trying to get all the searchterms to be available as one tag.
eg;
(in database)
SID = 1
Searchterm = dale hay
SID = 2
Searchterm = devnetwork
SID = 3
Searchterm = kittens in microwave
Now I'm wondering how I can get it so it reads them all out the database (which I know how to do) however it won't all add as one tag. >=[
^ Thats what i'm got so far, and before I used: but I want to scrap the manual way of doing it and have it being generated in teh database. Any ideas?
(Soz if that seems longwinded and boring and effortless... :/)
eg;
(in database)
SID = 1
Searchterm = dale hay
SID = 2
Searchterm = devnetwork
SID = 3
Searchterm = kittens in microwave
Now I'm wondering how I can get it so it reads them all out the database (which I know how to do) however it won't all add as one tag. >=[
Code: Select all
$sql = "SELECT * FROM searches";
$result = mysql_query($sql, $conn) or die(mysql_error());
while($r = mysql_fetch_array($result)) {
$thewords = $r['searchterm'];
}Code: Select all
$thewords = "dale hay devnetwork kittens in microwave";(Soz if that seems longwinded and boring and effortless... :/)