Jump to content

empty if/else???


The Little Guy

Recommended Posts

I have never done this, but I have an if/else statement, and if I don't want anything to happen in the if statement, should I leave it empty or is there something that I could add???

 

A simple example (my actual code is much longer):

<?php
if(empty($_POST['fname'])){

}else{
     $name = $_POST['fname']
     mysql_query("INSERT INTO name(`first`) VALUES ('$name'));
}
?>

Link to comment
https://forums.phpfreaks.com/topic/73354-empty-ifelse/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.