A little assistance

Started on the old forum in November 2009 · view the original in the archive · old links redirect here

12 replies · 617 views · started 17 years ago · 1 min read

4 participants
youngbobby Developer · 55 posts #1

Hi guys. I'm not too good with php buh i know asking helps alot.

for those of y'all who get wha i mean, this is what i want to do

for example.. A form submits info to dbase and their's a part of of dbase that carries keywords which are seperated with a comma ',' .

is there any possible way i could remove those comma's so i use the words for something useful like search tags.

see example dbase brings ' hi, boy, girl, this, that, you, me, hey, why, etc, etc.'

i remove comma's then we have like hi and so on for the others.

i hope someone gets what i mean 🙂

Naijatop.net = Mobile Traffic Booster 👑

📖 YoungBobby.com = Bobby's BLoG 😁

You're Welcome !!

youngbobby Developer · 55 posts #3

I hope this example makes more sense.

$do = "select * from keywords where name = '".$name."'"; $done = mysql_query($do) or die("error:".mysql_error());

lets say that the above outputs something like: "hi, hey, cool, test, best download, area, create, you, this, that, me"

as the keywords the user used for his site then i wanna strip off the comma's there then make it useful cos there might be other sites that have one or two of the keywords so user can find 'em

after stripping off the comma's, then i can use them for search query like hi or hey etc etc.

I just pray someone gets this one. 🙂

Naijatop.net = Mobile Traffic Booster 👑

📖 YoungBobby.com = Bobby's BLoG 😁

You're Welcome !!

subzero Super moderator Fellow · 3,954 posts #4

Did you mean to search for: Hi, hello

like that recommended search words ?🤨

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

youngbobby Developer · 55 posts #5

Lol okay maybe this example is better.

you, me, this, hey, girl, boy, who!

there are seven meaningful words above but it's in a sentence. I want to strip-off those comma's from those words so that it comes in bits (one by one) without the comma's then i link to each of them one by one and use them for search query. How do i do it?

Naijatop.net = Mobile Traffic Booster 👑

📖 YoungBobby.com = Bobby's BLoG 😁

You're Welcome !!

CreativityKills Lead · 833 posts #6

After retrieving d comma filled results use d explode function.

$res = $myql_result;
$bits = explode(',',$res);
// outputs an array.
//convert to link on d fly if u want
if(count($bits) !== 0){
foreach($bits as $keyword){
echo '<a href="search.php?q='.$keyword.'>'.$keyword.'</a>';
}
}else{
echo "No tags.";
}
//hope dat helps
youngbobby Developer · 55 posts #9

Yea i used the 'Thanks' feature. It's working but i have little problem as to when user uses space like some thing like hi, test, you,

after i explode as you thought, i still see %20 in url for example when i want to search for test as in above. Is there any way to fix this? Thanks 🙂

Naijatop.net = Mobile Traffic Booster 👑

📖 YoungBobby.com = Bobby's BLoG 😁

You're Welcome !!

youngbobby Developer · 55 posts #11

Yea but i want to strip off both the space and the comma. This is what i did

 
$res = $myql_result;
$b = explode(',',$res);
$bits = explode(' ',$b); 
// outputs an array.
//convert to link on d fly if u want
if(count($bits) !== 0){
foreach($bits as $keyword){
echo '<a href="search.php?q='.
$keyword.'>'.$keyword.'</a>';
}
}else{
echo "No tags.";
}

but it returned 'Array' for me

Naijatop.net = Mobile Traffic Booster 👑

📖 YoungBobby.com = Bobby's BLoG 😁

You're Welcome !!

CreativityKills Lead · 833 posts #12

Yes it returns an array. I said dat earlier. Replace d foreach block with:

foreach($bits as $keyword){
$keyword = str_replace(' ','',trim($keyword));
echo '<a href="search.php?q='.$keyword.'">'.$keyword.'</a>';
}

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close