Re: [PHP] Re: syntax question

2007-03-26 Thread Richard Lynch
None of the previous posts added any security... They all ONLY provided different syntax to leave your database wide open for abuse. This is much safer: $cat_name_sql = myqsl_real_escape_string($_POST['cat_name']); $query = "insert into categories (category_name) values ('$cat_name_sql')"; You c

[PHP] Re: syntax question

2007-03-26 Thread Ross
thanks. ""Ross"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Can I put post values directly into insert statements? > > $query = "INSERT INTO categories (category_name) VALUES > ('$_POST['cat_name'])"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: syntax question

2003-03-06 Thread Niels Andersen
By the way, beware of possibly buggy code: strpos() will return 0 if the string begins with '-', but it will return FALSE if '-' is not found in the string. Since both 0 and FALSE will evaluate to boolean false in your condition, you may get weird results. Use this instead: (strpos($a, '-') !==

[PHP] Re: syntax question - eregi()

2002-09-20 Thread Anthony Ritter
Thank you. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: syntax question - eregi()

2002-09-19 Thread Philip Hallstrom
If memory serves, $match will contain an array whose 0th element is the entire string and whose 1st element contains whatever is matched in the first (), 2nd element matches the second () and so on. Check the manpage for more... and when testing things like this out try adding the following for