![]() |
| Domain Name Sales | Domain Software | Calculate UK Domain Drop Dates | Domain Registration | NameDrive | Domain Parking | Subscribe to our Domains For Sale newsletter |
| | ||||||
| Home | Register | Rules | Membership Upgrade | Domains For Sale | Domain Name Escrow | Mark Forums Read | Domain Classified | Chat Room |
| Scripts and Coding PHP, MySQL, scripts |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
![]() | php mysql select query question
Is it possible to select a row with name = "bob's chocolates" when the variable you have is "bobs-chocolates" my issue isn't the hyphen (which I can do the preg_replace() ) but is the ' which has already been stripped and I don't know where to insert it to get a 100% match ? I know that when I'm selecting all names that begin with the same letter I use LIKE: SELECT * FROM table WHERE name LIKE '$name%' Is there a similar query that will negate apostrophes or other characters?
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #2 (permalink) |
![]() |
Think I've figured it out: SELECT name WHERE replace(name,'''','') = 'bobs chocolates'
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #3 (permalink) |
![]() |
You would be better looking into Full Text searches bud than running replaces MySQL :: MySQL 5.1 Reference Manual :: 11.8 Full-Text Search Functions
__________________ Browse: |
| |
| | #4 (permalink) |
![]() |
skinner you're like a walking php phrasebook. I'll take a look at the link. Thanks.
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #5 (permalink) |
![]() |
Pay special attention to things like Soundex You'll pick all these things up Just wait until your left broken and deflated because you missed a " or ' or ; or } or ) somewhere in the code and you stare at it for 3 days and are unable to see it, you'll soon realise that remembering stuff like this is easy :P
__________________ Browse: |
| |
| | #6 (permalink) |
![]() |
I'm usually pretty quick at the ,{; problems Probably because my projects are often small and I check small code changes religiously - so I can rollback the last change. I'm really excited about my current project though - the one that you've helping me out a bit on. Will probably post it on Acorn for appraisal and ideas in the next day or 2.
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #7 (permalink) |
![]() |
I try to include global debug variables. randomly insert if($debug==1){ ehco "debug X routine, value: $var";} Then at the top of my script I have $debug=0; That way when something goes wrong I can see where it went wrong very quickly, but other people don't want stuff like that in their code they want lean fast code so I have to take all the debug stuff out before I deliver it, then when I get 1000 lines of code back for updates I'm screwed if they have modded it as well :P The last project I'm working on that I may post on here, is the one I'm usin for the 'For Sale' links in my sig which the core program I posted http://www.acorndomains.co.uk/genera...page-vs-2.html you can see the debug code there. That took me a few hours to put together
__________________ Browse: |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Domain Name Community | Replies | Last Post |
| php query | woopwoop | Scripts and Coding | 2 | 28-12-2008 06:39:35 PM |
| Quick PHP Question | GreyWing | Scripts and Coding | 4 | 30-10-2008 03:09:53 PM |
