Jump to content

chiprivers

Members
  • Posts

    468
  • Joined

  • Last visited

    Never

Everything posted by chiprivers

  1. try taking the 0 out of the ' ' so it is: if (mysql_num_rows($tableVideos) ==  0) {
  2. Try this: [code] <td  width="59">' if (mysql_num_rows($tableVideos) ==  '0') { echo  "<img src=images/blog.jpg>"; } else { echo  "<img src=images/vlog.jpg>"; }'</td>" [/code]
  3. perhaps if you show us the rest of the script
  4. last bit that is currently like this: [code]$description = explode($search, $description); foreach ($description as $part) { echo $part; $num = count($description) for ($i=0; $i < $num; $i++) { echo $part[$i]; if ($i != ($num-1)) { echo "".$search.""; } }} echo "<hr>"; } ?> [/code] should be like this: [code] $description = explode($search, $description); $num = count($description) for ($i=0; $i < $num; $i++) { echo $part[$i]; if ($i != ($num-1)) { echo "".$search.""; } } echo "<hr>"; } ?> [/code]
  5. $num = count($description) for ($i=0; $i < $num; $i++) { echo $part[$i]; if ($i != ($num-1)) { echo "<b>".$search."</b>"; } }
  6. Oh right, I understand.  What we have done is loop through all the array values and each time we display it we are adding on the search term before the next value is shown.  What we have to do is work out when we have reached the last value in the array and not display the search term.
  7. you can specify default text in a form field by using value="blah" ie. [code] <input type="text" name="username" value="JoeBloggs"> [/code]
  8. is this the script that is or is not working?
  9. OK, what you need to do is then get a sub string from the original if the original string is too long #1 get string length using strlen() #2 check against maximum length allowable #3 if too long take first x number of characters from original string using substr() #4 display new string
  10. So you want a page that will query your database of users and return a list of only those that share an ip address with another member?
  11. could you post your current script
  12. I always us a seperate style sheet here is the CSS file: style.css [code] .title { font-family: arial; font-size: 12px; font-weight: bold; color: red } [/code] you would then put this in the header [code] <LINK REL=StyleSheet HREF="style.css" TYPE="text/css"> [/code] in your body you would then use this: [code] echo "<span class=\"title\">Welcome to my Site</span>"; [/code]
  13. If you are just looking at makign it text based, I am sure you will be able to do it with PHP and MySQL somehow.  You just have to decide exactly what you want it to do and then set out the various rules into PHP.
  14. Did you replace echo "<b>".$search."</b>"; with echo "<span style=\"background-color: yellow\">".$search."</span>";
  15. try this to highlight text: [code] exho "<span style=\"background-color: yellow\">".$search."</span>"; [/code]
  16. post your completed script here and I'll check whats putting them funny bits on the end
  17. Sorry again, I didn't actually add any script to highlight the script, not sure on what to do to make it highlighted, but to check what we have done so far you could make the word bold: [code] echo "<br>".$search."<br>"; [/code]
  18. So am I right thinking that you want a list of links that are vehilce manufacturers (ie Ford, Vauxhall, Skoda etc) and when click on one of these it will take you to a page where it will pull all records from details to provde a list of vehilces made by that manufacturer. Is that right?
  19. sorry, change last bit so like this: [code]//display the row echo "<h2>".$title."</h2>"; echo "<h3>".$date." by ".$user."</h3>"; $description = explode($search, $description); foreach ($description as $part) { echo $part; echo $search; // add any highlighting in this section } echo "<hr>"; } ?> [/code]
  20. There may be a simpler way but you could try putting each result into an array and then use the position in the array + 1 to get number to display?
  21. Actually that will return the number of characters and I guess to prevent splitting any words, really you will want the number of words.  Not sure if there is a function to count words in a string but you could explode string using the space as the delimiter and then count the number of words in the new array.  You could then display the first x number of values in the array remembering to put a space between each value.
  22. strlen($string);
  23. Just had a quick look at how to use explode() and it would be slightly different to what I said.  When exploding a string you set a delimiter for which it searches for and uses to split up the original string into the array. In doing this, it removes the delimiter altogether so you would not end up with any values in the array equal to the search keyword, this actually makes it a bit simpler as you know that between every two values in the array, there should be your keyword. so try this: [code] $description = explode($search, $description); foreach ($description as $part) { echo $part; echo $search; // add any highlighting in this section } [/code] This will all need to fit in where you have displayed $description.  It may need some slight alteration, it is not something i have done before.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.