|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
mysql madness
I've a bit of a problem here, and I am hoping someone can help me here.
I've got a simple database with a simple table in it that contains nothing but content. The client wants to be able to edit this content. That's fine, that's all working properly. She's not savvy, however, and doesn't want to learn anything about linking. The question is this: is there a way to dump the data from a field (the field is "content") to the page, processing it such that if a word exists (like "%link|linkword" for example) in the query, how can I make PHP create a link out of that (in the place it is pulled from in the content) such that it displays as... Code:
<a href="index.php?page=$page&sub=$link>linkword</a> So far I've tried using explode and implode (each word dumped into an instance of $array) to dump it all into an array and search that array for instances where the word begins with %, and I can't seem to get it right. Any insight? |
|
#2
|
|||
|
|||
|
RE: mysql madness
I think you would need a character marking the beginning and ending like this: %link|linkword%. I believe the function eregi_replace() is what you are looking for, however I lack the regular expression knowledge to code one up for you
|
|
#3
|
|||
|
|||
|
RE: mysql madness
|
|
#4
|
|||
|
|||
|
RE: mysql madness
man, i gotta learn to do those
|
|
#5
|
|||
|
|||
|
RE: mysql madness
Thanks a lot. That worked great. Regular expressions have always killed me, so I always try to find a different way to do things.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > mysql madness |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|