grahamb314 Posted September 15, 2008 Share Posted September 15, 2008 Hi, Does anyone know why this does not echo? The POST is an int and works correctly in other code I have Is it a syntax thing? I get no errors if ( $_POST["Day"] = 0 ) {$day = "Monday";} else {}; echo $day; Thanks Link to comment https://forums.phpfreaks.com/topic/124371-solved-sql-variable/ Share on other sites More sharing options...
Mchl Posted September 15, 2008 Share Posted September 15, 2008 Use == not = if ( $_POST["Day"] == 0 ) {$day = "Monday";} else {}; echo $day; By using if($_POST['Day'] = 0) you actually set $_POST['Day'] to 0 which evaluates to false; Link to comment https://forums.phpfreaks.com/topic/124371-solved-sql-variable/#findComment-642307 Share on other sites More sharing options...
grahamb314 Posted September 15, 2008 Author Share Posted September 15, 2008 Perfect, thanks Link to comment https://forums.phpfreaks.com/topic/124371-solved-sql-variable/#findComment-642324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.