Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-24-2009, 09:07 PM quote smart issue
Junior Talker

Posts: 1
Name: Pamela Coupar
Trades: 0
Hi,

One of the user's using the site that I work on put in some text containing a % character into a query that used quote_smart. It produced the mysql error Query is empty. I have since used ereg_replace to replace the % sign with the html equivalent. Just curious if there is a better way to do this. The site uses PHP 4.
Pamela C is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-25-2009, 07:19 PM Re: quote smart issue
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Using ereg_replace() or preg_replace() will work just fine, but they are both designed for use of regular expressions. If you just want to replace a characture, you can use a more efficient method of str_replace() which is better if you don't require regex. Another tip is that you can pass an array of charactures for the needle.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to quote smart issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12537 seconds with 12 queries