Find Jobs
Hire Freelancers

Change my php/mysql-code - Optimize search-function

€8-30 EUR

Completed
Posted over 5 years ago

€8-30 EUR

Paid on delivery
Hi, I've got a PHP-code (see attached file). It is a script for searching my mysql-database. It orders by relevance (title *4 and content *1) $search_text is from a search-form. I need the following changes: 1) make the code secure against injections and other danger things 2) make the code work for more than one search-word. right now it works only for one-word-searches (for example "tree"). I need it to work also for more words ("my red tree"). So check the results for "my", for "red" and "tree" and sort by relevance. 3) make the code work for all german letters ä (= ae) ö (= oe) ü (= ue) ß (= ss) 4) optimize the code for performance. The table has more than 50.000 entries.
Project ID: 18004341

About the project

12 proposals
Remote project
Active 5 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I made loads of dynamical searches for various platforms, I can certainly help you with this. And you'll get it on time and budget!
€29 EUR in 4 days
5.0 (5 reviews)
3.2
3.2
12 freelancers are bidding on average €35 EUR for this job
User Avatar
Hi there Are you running your code in WordPress? or is this script outside of WordPress? Regards Junaid ....
€34 EUR in 0 day
5.0 (116 reviews)
7.2
7.2
User Avatar
hello i can improve your code so you can search for mor than one word and optimise it for large database i have over 13 years of experience working on xamp technologies. i providz a clean code and total satisfaction with the job lets talk on private for more details thank you
€70 EUR in 3 days
5.0 (65 reviews)
7.0
7.0
User Avatar
Hi, I have had look at your php file having function for fetching records and following observations. 1- Security i. very 1st thing you must do user filter_var as the input is submitted by user and then validate the input for valid expected data. ii- input must be escaped using mysqli_real_escape_string($con, $input) before using it in any sql query to prevent inject attacks. 2- I don't know what sort of select is used currently for fetching right records and I wonder why fulltext search was not used. I can advise and write and optimized select query for your search function after looking at your database. If you database is hosted on your website I can remotely access and do the job Let me know if you want me to work for you on this Regards Ahmed
€34 EUR in 0 day
5.0 (38 reviews)
6.5
6.5
User Avatar
Hello, i'll help you in your task. I will do it as per your guidance. Please initiate a chat session so we can discuss more about it. thank you.
€29 EUR in 1 day
5.0 (4 reviews)
3.0
3.0
User Avatar
Hello sir, I would like to take and complete your job, I will be working in PHP , mySQL and HTML/CSS/Bootstrap. 1) Easy job 2) Yeah this is easy aswell by using the LIKE query statment. 3) Okay this can be done 4) I can optimize it by adding pagination to the table , every page in the table will have like 5 or more rows ( Or whatever you want ,just like google search ) Hope you choose me for your job. Thank you and good day sir ^^
€12 EUR in 1 day
5.0 (2 reviews)
2.1
2.1
User Avatar
Guten tag. By the table structure (X_posts, post_title, post_content) it looks like you're using WordPress. Irrespective, I can do the following with your current code and database (MySQL): - Sanitize the search phrase (prevent injection) - Tokenize the search phrase (split into individual keywords) - Alias the given umlauts and double-s with their Latin equivalents - Optimize the PHP code - Maintain your relevancy weighting With database access, I can perform some further optimizations by adding indices and maybe fulltext type index, but MySQL is still not ideal for this. MySQL will be a bottleneck. I would propose/recommend to use SOLR as your search provider, which is purpose-designed for just such search cases, and would be far more performant, and can in addition return spelling-corrected results with spelling suggestions (whereas MySQL doesn't handle fuzzy search very well). Perhaps we can implement this MySQL-based search first and then explore SOLR in the near future. There are some very low cost providers (5 Euro/mth) .
€50 EUR in 2 days
5.0 (4 reviews)
1.9
1.9
User Avatar
Hi, Please accept my application. I desperately looking for job and I am ready to work in cheap price. I have more than 8 years of experience in PHP/MySQL/HTML/CSS/Jquery, CMS like Wordpress and framework like CodeIgniter/Yii/CakePHP and completed many projects successfully. I have read your job description and I find myself the perfect match for the project. I am sure that I will fulfill your requirements within your timeline. I would be grateful if you giving me a chance to work with you. Thanks a lot for your valuable time & waiting for your response eagerly! Best regards, Nayanjyoti Hazarika
€23 EUR in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
hallo :) ich bin maryam i think this sql code handel your work SELECT * FROM nbaplayermaster WHERE "{$search_text}" LIKE Concat(Concat('%',firstname),'%') OR "{$search_text}" LIKE Concat(Concat('%',lastname),'%')
€23 EUR in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of GERMANY
Eppelheim, Germany
5.0
20
Payment method verified
Member since Aug 5, 2017

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.