Re: [PHP] build sql query struture and values from form fields

2005-08-22 Thread Jordan Miller
I agree, you must be careful of SQL injection... use mysql_real_escape_string(). To chop off the last character of text use substr(): $sqlstruct = substr($sqlstruct, 0, -1); Jordan http://www.php.net/substr Example 3. Using a negative length On Aug 20, 2005, at 4:55 PM, Greg Donald wro

Re: [PHP] build sql query struture and values from form fields

2005-08-20 Thread Greg Donald
On 8/20/05, Andras Kende <[EMAIL PROTECTED]> wrote: > I would like to create the mysql insert query for my html form fields, > I have a small problem it will have an extra , at the end of $sqlstruct > And extra "" at $sqldata.. > > Anyone can give a hint ? > > > foreach ($_POST as $v

[PHP] build sql query struture and values from form fields

2005-08-20 Thread Andras Kende
Hello, I would like to create the mysql insert query for my html form fields, I have a small problem it will have an extra , at the end of $sqlstruct And extra "" at $sqldata.. Anyone can give a hint ? foreach ($_POST as $variable=>$value){ $sqlstruct.=$variable","