I am trying to figure out the correct syntax to check if a variable if not null. There are 2 variables that may or may not have a value. If the first variable is not null, then I want to execute a mysql query, otherwise I want to check to see if the second variable is not null. I keep getting an error - unexpected T_IS_NOT_EQUAL .
Here is the code snip:
...
$in_lname = $_POST["l_name"];
$in_f_name = $_POST["f_name"];
$in_city = $_POST["city"];
$in_state = $_POST["state"];
?>
</select><p><p>
<input name="submit" value="Submit" type="submit">
</form>
<?php
//connect to database
$link = mysql_pconnect('localhost', 'xxxxx, 'xxxxx');
if (!$link) {die('Could not connect: ' . mysql_error());}
mysql_select_db("xxx", $link);
[COLOR="Red"]if ($in_lname) <> " "[/COLOR]
$get_member_sql = "SELECT mbr_id, f_name, l_name from member_name where l_name like '%$in_lname%'";
$get_member_res = mysql_query($get_member_sql, $link)
or die(mysql_error());
[COLOR="Red"]else if ($in_fname) <> " "[/COLOR]
$get_member_sql = "SELECT mbr_id, f_name, l_name from member_name where f_name like '%$in_fname%'";
$get_member_res = mysql_query($get_member_sql, $link)
or die(mysql_error());
else exit;
...