searls03 Posted April 30, 2011 Share Posted April 30, 2011 How can I make it so that $year-$month-$day is the value of $shutoff. So when it posts to database, it will be in date format..........so something like $shutoff = $_POST['$year-$month-$day'] or [year-month-day]. Those are dashes not minuses.........is that correct format also? How do I do something like this? Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/ Share on other sites More sharing options...
fugix Posted April 30, 2011 Share Posted April 30, 2011 $shutoff = $year . "-" . $month . "-" . $day; should be what you are looking for Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/#findComment-1208679 Share on other sites More sharing options...
fugix Posted April 30, 2011 Share Posted April 30, 2011 are you setting your $year $month $day vars to $_POST vars? Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/#findComment-1208680 Share on other sites More sharing options...
Pikachu2000 Posted April 30, 2011 Share Posted April 30, 2011 Assumes your form fields are named 'year', 'month', and 'day' . . . $date = "{$_POST['year']}-{$_POST['month']}-{$_POST['day']}"; Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/#findComment-1208681 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 Assumes your form fields are named 'year', 'month', and 'day' . . . $date = "{$_POST['year']}-{$_POST['month']}-{$_POST['day']}"; that the form names, but the field in database will be called shutoffdate.........so I need those three pieces to submit to one field. Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/#findComment-1208682 Share on other sites More sharing options...
Pikachu2000 Posted April 30, 2011 Share Posted April 30, 2011 The full date in YYYY-MM-DD format is assigned to the $date variable, so that's what you'd use for the value to insert into the field in the query string. Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/#findComment-1208683 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 ok, I think I got it! Quote Link to comment https://forums.phpfreaks.com/topic/235198-multiple-strings-being-value-of-one-string/#findComment-1208684 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.