Ross wrote:
Can I put post values directly into insert statements?

$query = "INSERT INTO categories (category_name) VALUES ('$_POST['cat_name'])";
Yes, although this is not recommended.
What is someone puts a single quote in there? Or some other bad characters....

otherwise... 2 options:

$query = "INSERT INTO categories (category_name) VALUES ('".$_POST['cat_name']."')";
-or-
$query = "INSERT INTO categories (category_name) VALUES ('{$_POST['cat_name']}')";

-Brad

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to