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.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to