Webmaster Discussion Forum -  Revenue Sharing Forum  webmaster talk related topic
3000+ Free Tutorials, Read and learn from Picture and text
FREE Tutorials on Flash, Photoshop, PHP, 3DS, MySql and more.
Add your tutorials and get more traffic !

» Free SEO Tools
» Check Page Rank
» Check Page Rank multi datacenter
» Check Fake Page Rank
» Alexa Traffic Rank
» Bulk Page rank Check
» Link Popularity
» Check domain Instantly
» Short url
» MD5 Encrypt
» Meta Tags Extractor
» Surf using Proxy
» Keyword Density Analyzer
» Keyword Analyzer
» Welcome to WMH
Registration at WebmastersHome is completely FREE and takes only a few seconds. By registering you'll gain:
  • Full Posting Privileges.
  • Access to Private Messaging.
Register now
Partner

Text Link Ads
Web Hosting
Flash Tutorials
PHP Scripts
Web Hosting providers
Offshore Software Outsourcing
Web Directory
Software Directory
Your Text Link
Earn More
Simply Add a Post and view ad network advertisement on this post.


Go Back   Webmaster Discussion Forum - Revenue Sharing Forum webmaster talk related topic > Design and Programming Talk > Databases


SQL Querry Help2

Databases


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-07-2005, 06:09 AM
nikhiltechnology nikhiltechnology is offline
Senior Member
 
Join Date: May 2005
Location: Indore, India
Posts: 185
nikhiltechnology is on a distinguished road
iTrader: (0)
Default SQL Querry Help2

Hello Friends

I have a record in a MySQL Table that has a field that contains a string that has a single quotation (i.e., Mark's). Now when I attempt to retrieve the record based upon the field that contains the string with the single quotation I get an error


Code:
strSQL = "SELECT * FROM MyTable WHERE Field_1 = 'Mark's'"



I tried formating the string using the Escape Character '\' and two single quotations, with no success:



Code:
strSQL = "SELECT * FROM MyTable WHERE Field_1 = 'Mark\'s'"





Code:
strSQL = "SELECT * FROM MyTable WHERE Field_1 = 'Mark
Code:
''
Code:
s'"

When I execute the above SQL against the table I get the following error. I am able to save any string with either the single or double quotations.

Reguards
Nikhil
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Revenue Sharing Ads ( Read More ):

  #2 (permalink)  
Old 06-25-2005, 02:39 PM
jitender's Avatar
jitender jitender is offline
Site Admin
 
Join Date: Jun 2004
Posts: 1,200
jitender has a spectacular aura aboutjitender has a spectacular aura aboutjitender has a spectacular aura about
iTrader: (0)
Default

hi nikhil


try below

PHP Code:
SELECT FROM `mytableWHERE `field_1LIKE 'mor\'s' LIMIT 0 30


Regards
Jitender
__________________
Free Webmaster Tools - Free SEO Tools
phpLDHacks - Add your template or Hack and earn money
Text Link Ads - Buy & Sell text link ads
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 10:38 PM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0