Jump to content

Search the Community

Showing results for tags 'match'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hi, The following code seems to be echoing the array numbers. I actually need to echo the array value and not the numbers. Echo: Values of the matched banned words. Echo: Values of the non-matched banned words. So, how to correct the following code which shows results like this: Script 5a - No Match: (0) Script 5a - Banned: array(1) Script 5a - Banned: array(2) Script 5a - Banned: array(3) Script 5a - Banned: array(4) NOTE: "0" is being shown as "no match". But how come when "0" exists both in the content and banned words array ? <?php //script 5d: https://stackoverflow.com/questions/32522192/check-if-an-array-element-is-in-a-string $banned_words = array("0","1","2","3","4"); $content = "0,1,2,3,4,5,6,7,8,9"; for($i=0; $i < count($banned_words); $i++) { if(strrpos($content, $banned_words[$i]) != FALSE ) { echo "Script 5a - Banned: array($banned_words[$i])<br>"; // Place "break;" if you want it to stop after finding a match. }else{ echo "Script 5a - No Match: ($banned_words[$i])<br>"; } // Why is it echoing the array numbers instead of the array values ? } ?>
  2. I currently have a fulltext search that works. It matches against a item title column in mysql database. Now I would like to include another column to match against. How can that be done properly? Here's my code. Where it says MATCH, I would like to include the type_1 column as well; like this(type_1.type_1_name). $get_records = $db->prepare("SELECT items.*, type_1.* FROM items LEFT JOIN type_1 ON items.type_1 = type_1.type_1_id WHERE MATCH(items.item_title) AGAINST('$search_query' IN BOOLEAN MODE) ORDER BY items.item_id DESC LIMIT {$limit} OFFSET ".$offset); $get_records->execute(); $result_records = $get_records->fetchAll(PDO::FETCH_ASSOC); if(count($result_records) > 0){ foreach($result_records as $row) { // get results } }
×
×
  • 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.