Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:25 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Using ", ' or ` in PHP?
PostPosted: Fri May 02, 2008 6:06 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Fri May 02, 2008 5:53 pm
Posts: 1
Points: 0
I am working on lesson 22 on the learnphpfree.com site: http://www.learnphpfree.com/lesson-22-s ... -vt97.html

The lesson had me type this line of PHP code:
Code:
$query = 'INSERT INTO `contacts` (`name`, `phone`, `address`)
VALUES (\'Bob\', \'999-555-5555\', \'TX\');';


When I originally typed it in I used this to surround the fields: '
But my code would not run. Then I tried using this instead: `
But my code still would not run.

Then, I did a copy and paste directly from the code entered on the tutorial and my code ran.

Why would this be, and which quote keys am I supposed to use where?


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: Using ", ' or ` in PHP?
PostPosted: Fri May 02, 2008 8:55 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
I always use \' because I know it's working. I don't know about ´ but it may depend on your keyboard settings (not sure if ´is the same everywhere and on different computers).

/Andreas

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]