I am wanting to add a menu name, only if the user has entered a name into the menuname text box. Or I need to add a menu name if the user has selected something from a combo box. Can someone please tell me a better way to do this? I am getting nowhere with this.

When I tested my code that is below I got this error: Could not add the entry because: Query was empty. The query was INSERT INTO `menu` (`menuname`, `page_title`)
VALUES ('alone', 'Home').

Code PHP:
// insert data into the menu table - $menuname or $selectMenuname
			// if $menuname is not empty
			if (!empty($menuname)) {
				// then insert that menu name into the database
				$insert1 = "INSERT INTO `menu` (`menuname`, `page_title`)
						   VALUES ('$menuname', '$pagetitle')";
				if (mysql_query ($insert1)) {
					// select the last inserted menuid
					$query1 = mysql_query("SELECT menuid FROM `menu`") or die ("Could not query because: ".mysql_error());
					$row1 = mysql_fetch_assoc($query1);
					$menuid = mysql_insert_id();
					// then insert the menuid into the pages table
					// along with the page's content
					$insert3 = "INSERT INTO `pages` (`menuid`, `button`, `page_title`, `content`, `keywords`, `description`, `active`, 	`images`, `imagenames`)
					VALUES ('$menuid', '$button', '$pagetitle', '$pageContent', '$keywords', '$description', '$active', '$images', '$imagenames')";
				// if everything is ok
				if (mysql_query ($insert3)) {
					// go to the next page
					header ("Location: page_added.php?pagetitle=".$pagetitle);
				} else {
					print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $insert3.</p>";
				}
				} else {
					print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $insert1.</p>";
				}						
 
			// if $selectMenuname is not equal to none
			} elseif ($selectMenuname != 'none') {
				// then insert that menu name into the database
				$insert2 = "INSERT INTO `menu` (`menuname`, `page_title`)
						   VALUES ('$selectMenuname', '$pagetitle')";
				if (mysql_query ($insert1)) {
					// select the last inserted menuid
					$query1 = mysql_query("SELECT menuid FROM `menu`") or die ("Could not query because: ".mysql_error());
					$row1 = mysql_fetch_assoc($query1);
					$menuid = mysql_insert_id();
					// then insert the menuid into the pages table
					// along with the page's content
					$insert3 = "INSERT INTO `pages` (`menuid`, `button`, `page_title`, `content`, `keywords`, `description`, `active`, 	`images`, `imagenames`)
					VALUES ('$menuid', '$button2', '$pagetitle', '$pageContent', '$keywords', '$description', '$active', '$images', '$imagenames')";
				// if everything is ok
				if (mysql_query ($insert3)) {
					// go to the next page
					header ("Location: page_added.php?pagetitle=".$pagetitle);
				} else {
					print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $insert3.</p>";
				}
				} else {
					print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $insert2.</p>";
				}						
			}

Thanks in advance.