Jump to content

confused between ' ' and " "


davids701124

Recommended Posts

there is a php i set:

$begin_date_query = mysql_query( "SELECT SUBDATE(due_date, INTERVAL $days_expected DAY) AS begin_date FROM baby WHERE baby_id = $_SESSION['baby_id']" );

 

'coz of the double quote, the variable $_SESSION['baby_id'] always be convert into string. how can i keep it as a variable, especially there is single quote go around!!! tried many combination but doesn't work. totally confused @@.

Link to comment
Share on other sites

You code is fine (though arrays ought be surrounded by {} within double quoted strings) unless you actually want to insert the literal $_SESSION['baby_id'] into your db which makes no sense.

 

You might need to give us a clearer explanation of your scripts intended purpose.

Link to comment
Share on other sites

You code is fine (though arrays ought be surrounded by {} within double quoted strings) unless you actually want to insert the literal $_SESSION['baby_id'] into your db which makes no sense.

 

You might need to give us a clearer explanation of your scripts intended purpose.

 

so u mean i should make it like  {$_SESSION['baby_id']}  ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.