# PHP Puzzle



## Moose (Dec 9, 2009)

I basically want it to NOT 
	
	



```
"UPDATE content SET logo = '$logo'"
```
 if $logo is blank, so im thinking put in an *if* but I dont know how to say logo is not ""
So I want

```
if ($logo does not = ""){
```
after the $db_found bit.
Heres the part of the code in question:

```
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
	$logo = $_POST['logo'];

$username = "root";
$password = "Password";
$database = "moose";
$server = ":/home/moose/private/mysql/socket";

$db_handle = mysql_connect($server, $username, $password);
$db_found = mysql_select_db($database, $db_handle);

if ($db_found) {
$SQL = "UPDATE content SET logo = '$logo'";

mysql_query($SQL);

mysql_close($db_handle);
}

}
```


----------



## Disparia (Dec 9, 2009)

Does not equal is "!="

Can put it up front, so that if it's empty, cycles aren't wasted creating a connection.


```
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['logo'] != '') {
```


----------



## Moose (Dec 9, 2009)

Aha thanks for that that helps with the rest of the script too!


----------

