![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programmer
Join Date: Jul 2005
Posts: 66
Rep Power: 4
![]() |
Re: Simple PHP Search Script
Okay, done.
Now I get this error: SELECT * FROM users WHERE info LIKE '%HELLO%'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIKE '%HELLO%'' at line 1 With this code: php Syntax (Toggle Plain Text)
this is the code in the mysql database mysql Syntax (Toggle Plain Text)
|
|
|
|
|
|
#12 |
|
PFO Founder
![]() ![]() |
Re: Simple PHP Search Script
Look at line 49 of the code that you just posted.
Looks like this: php Syntax (Toggle Plain Text)
php Syntax (Toggle Plain Text)
Right now you aren't using the $sql variable that you used to change the sql statement.
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#13 |
|
Programmer
Join Date: Jul 2005
Posts: 66
Rep Power: 4
![]() |
Re: Simple PHP Search Script
Ahh okay, I got it now. No errors anymore- now just this:
SELECT * FROM users WHERE info LIKE '%PEGGY%'Sorry, but we can not find an entry to match your query So peggy which is in the database isn't even showing up x_x |
|
|
|
|
|
#14 |
|
PFO Founder
![]() ![]() |
Re: Simple PHP Search Script
I don't know for sure but my guess is that the problem probably has something to do with the info column being a blob. Might want to change that to TEXT or read through MySQL's documention about the blob type and see if there is a way to look through it using like. Not sure how that data type really works. Maybe someone else can recommend something.
http://dev.mysql.com/doc/refman/5.0/en/blob.html BLOB is for Binary objects so I would recommend changing that column to text.
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#15 |
|
Programmer
Join Date: Jul 2005
Posts: 66
Rep Power: 4
![]() |
Re: Simple PHP Search Script
SWEET
Now a simple problem here: What it does is this: SELECT * FROM users WHERE info LIKE '%JIM%'Jim Jones In his spare time Jim enjoys biking, eating pizza, and classical music That's what it echoes. I need to get rid of the beginning part, of course. The code is found on this line: $sql = "SELECT * FROM users WHERE info LIKE '%$find%'"; |
|
|
|
|
|
#16 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Simple PHP Search Script
Well obviously don't
echo $sql. Did you not write this script yourself? |
|
|
|
|
|
#17 |
|
Programmer
Join Date: Jul 2005
Posts: 66
Rep Power: 4
![]() |
Re: Simple PHP Search Script
No, a friend gave me the script to practice on.
Now- I believe that solves everything really. Now I need to figure out how to make the outputed searched material have a link to a review page for that website, a link to the website, a rating of the website and somehow have keywords for each data... |
|
|
|
|
|
#18 |
|
Programmer
Join Date: Jul 2005
Posts: 66
Rep Power: 4
![]() |
Re: Simple PHP Search Script
I'm actually just going to scratch the search thing and think up a whole new idea for my website...
![]() |
|
|
|
|
|
#19 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Re: Simple PHP Search Script
Yo, mods. I see spam.
|
|
|
|
|
|
#20 |
|
PFO Founder
![]() ![]() |
Re: Simple PHP Search Script
taken care of Ooble
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP script ending prematurely causing Internal Error...??? | Syntax_Error | PHP | 2 | Feb 29th, 2008 8:42 PM |
| Parsing PHP script output | bulio | PHP | 1 | Feb 18th, 2008 6:41 PM |
| A simple script isn't working correctly | scuzzman | Perl | 3 | Dec 23rd, 2005 6:42 AM |
| A simple perl script | satimis | Perl | 3 | Aug 15th, 2005 9:31 AM |
| A simple script to execute a command package | satimis | Bash / Shell Scripting | 3 | Aug 12th, 2005 11:28 PM |