Jump to content

Dville

Members
  • Posts

    88
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dville's Achievements

Member

Member (2/5)

0

Reputation

  1. right now it only searches for the 'body' row, i'd like it to search the body and title row, and return the article if either shows a match. i've tried adding it, but due to the php format, and it being chopped up like that, i can't get the syntax correct
  2. I dunno what that means. wouldnt the keyword be 'ubuntu', which i see is in there
  3. the first pasted code is an echo of the bottom query
  4. [code]SELECT * FROM articles WHERE body LIKE '%ubuntu%'[/code] There is another query being ran. But in the code it's chopped up in an odd way i dont understand [code]$query = "SELECT * FROM articles " . "WHERE body LIKE '%".$keywords['0']."%'";[/code]
  5. says [code]SELECT COUNT(id) AS numrows FROM articles WHERE body LIKE '%ubuntu%'[/code]
  6. Not sure what you're asking for, but here is all of my search.php page http://phpfi.com/141089
  7. Awesome, that works out perfectly!
  8. Here is my code [code]// counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $keywords = explode(" ", $search); $query = "SELECT * FROM articles " . "WHERE body LIKE '%".$keywords['0']."%'"; for ($i=1; $i<count($keywords); $i++) { $query = $query." AND body LIKE '%".$keywords[$i]."%'"; } $query = $query." ORDER BY id DESC LIMIT $offset, $rowsPerPage"; $result2 = mysql_query($query) or die(mysql_error()); ?> <form method="GET" action="search.php"> <b>Search:</b> <input type="text" name="search" size="20" /> <input type="submit" value="Search!" /> </form><br><br> <table width="50%" style="border:1px solid #000000;"> <?php $keywords = explode(" ", $search); $query = "SELECT COUNT(id) AS numrows FROM articles " . "WHERE body LIKE '%".$keywords['0']."%'"; for ($i=1; $i<count($keywords); $i++) { $query = $query." AND body LIKE '%".$keywords[$i]."%'"; } $result = mysql_query($query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage);[/code] But I would also like to search both 'body' and 'title'. Due to syntax issues, and not knowing which exact line to edit, I have failed at trying to get it to search both rows. Thanks in advanced to anyone who can help me with this.
  9. So would I update the 'confirm' row in confirm.php, to something like 'confirmed' and in login.php, have it check for confirmed in the  confirm row, and if it is anything other than 'confirmed' then not allow them to login?
  10. new signups, yes. before allowing them to sign into their account
  11. I would like to add email confirmation to my current basic member system. Does anyone know of any articles, that can explain how to add this. Or maybe does anyone know of a simple concept of how this would actually work? I am pretty clueless when it comes to what goes on behind the scenes during an email confirmation. Thanks in advanced.
  12. // This code will remove the '&' chracters to prevent it from breaking the rss feeds $oldWord = "&"; // The new word we want in place of the old one $newWord = "&#38;"; // Run through the text and replaces all occurrences of $oldText $ArticleBody = str_replace($oldWord , $newWord , $ArticleBody); figured it out, rock on
  13. I am looking to take a string stored in $variable, and search it for the & character, and replace it with '&#38;' without the ' ' before placing into the database. I find this character breaks the xml feed, and I'd rather not have to edit the database each and every time. Thanks in advanced to anyone that can help with this trick.
  14. I did figure that out, and now I come across the & issue. I change that to '&#38;' and that fixes that. Wouldnt there be some sort of parser, that will automaticly change these things. Instead of me having to change them from the database.
×
×
  • 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.