davids701124 Posted October 27, 2009 Share Posted October 27, 2009 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 More sharing options...
trq Posted October 27, 2009 Share Posted October 27, 2009 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 https://forums.phpfreaks.com/topic/179162-confused-between-and/#findComment-945223 Share on other sites More sharing options...
davids701124 Posted October 27, 2009 Author Share Posted October 27, 2009 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 More sharing options...
trq Posted October 27, 2009 Share Posted October 27, 2009 Yes, but it will also function as is. Link to comment https://forums.phpfreaks.com/topic/179162-confused-between-and/#findComment-945252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.