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 @@. Quote Link to comment 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. Quote Link to comment 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']} ? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.