jeppers Posted March 6, 2011 Share Posted March 6, 2011 i can't seem to get the statment to work $filename = $f; $name = $n; if ($n == $n){ include_once('test2.php'); mysql_query ("INSERT INTO images (filename) VALUES ('$n')"); }else{ include_once('test2.php'); mysql_query ("INSERT INTO images (filename) VALUES ('$f')"); } when i execute the code it seems only to upload to the database to when the $n values or false.. any ides what i can do.... before the question is asked there is no error code... Link to comment https://forums.phpfreaks.com/topic/229765-simple-if-else-statment/ Share on other sites More sharing options...
kenrbnsn Posted March 6, 2011 Share Posted March 6, 2011 Why are you comparing $n to $n? <?php if ($n == $n){ ?> Ken Link to comment https://forums.phpfreaks.com/topic/229765-simple-if-else-statment/#findComment-1183529 Share on other sites More sharing options...
jeppers Posted March 6, 2011 Author Share Posted March 6, 2011 to make sure that it is true and then, run it. if not run the next query. that's how i have been thinking. or should i compare $n == $f? Link to comment https://forums.phpfreaks.com/topic/229765-simple-if-else-statment/#findComment-1183530 Share on other sites More sharing options...
kenrbnsn Posted March 6, 2011 Share Posted March 6, 2011 What is this code segment supposed to do? Ken Link to comment https://forums.phpfreaks.com/topic/229765-simple-if-else-statment/#findComment-1183532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.