Two little questions

From: Date: Sun, 14 Jan 2001 16:51:07 +0000
Subject: Two little questions
Groups: php.general 
Request: Send a blank email to php-general+get-34476@lists.php.net to get a copy of this message
OK, this will be laughably easy for you guys. I want to write a function (until now, I have been heavily repeating code, but it's time to trim everything down.) The function basically needs to check that username and password have been entered, and then check them against mysql data. All I am unsure of is the format for the function... is it like this: function CUP ( if ((!$alias) || (!$password)) { header("Location: login.php"); exit; } ); And reference it later with CUP(); ? Don't worry about the MySQL side of things, I just need to know how to lay out the function. Oh and if I can put anything I want in the function. Also, if I wanted to perform a search of a column in a mysql table for "places", would the Syntax be something like this: $sql = " SELECT * FROM table_name WHERE place = LIKE \"$searched_word\" "; ? Thanks in Advance, James.

« previous php.general (#34476) next »