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
https://forums.phpfreaks.com/topic/179162-confused-between-and/
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
https://forums.phpfreaks.com/topic/179162-confused-between-and/#findComment-945234
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.