Re: [PHP] mysql insert internal server error 500

2011-05-16 Thread Bálint Horváth
I think it's not the best place to send it but: $dolgF is not closed with ; ...and the insert is not in a variable! (And also I think it's not a good way using COOKIE in PHP because we have sessions) So the answer is: the all.. :D -or what's the full part you use for insert int this source!?

Re: [PHP] MYSQL insert problems

2008-10-17 Thread chris smith
On Sat, Oct 18, 2008 at 3:22 AM, Frank Stanovcak <[EMAIL PROTECTED]> wrote: > I'm using the following code to try and do a simple insert query. However > it won't insert the data into the table, and I get no error messages. What > have I done wrong this time? You will be getting an error. echo

Re: [PHP] Re: PHP MySQL insert

2005-08-20 Thread areguera
On 8/19/05, Richard Lynch <[EMAIL PROTECTED]> wrote: > On Fri, August 19, 2005 12:56 pm, areguera wrote: > >> could you suggest something about Latin characters and portability?. > > As I understand it, or not, more likely, you want to configure your > MySQL server to use UTF-8, and your MySQL cli

Re: [PHP] Re: PHP MySQL insert

2005-08-19 Thread Richard Lynch
On Fri, August 19, 2005 12:56 pm, areguera wrote: >> could you suggest something about Latin characters and portability?. As I understand it, or not, more likely, you want to configure your MySQL server to use UTF-8, and your MySQL client to use UTF-8 and pretty much everything to use UTF-8, and t

Re: [PHP] Re: PHP MySQL insert

2005-08-19 Thread areguera
sorry...here is the message On 8/19/05, areguera <[EMAIL PROTECTED]> wrote: > On 8/19/05, Ben Ramsey <[EMAIL PROTECTED]> wrote: > > Alain Reguera Delgado wrote: > > > you could try: > > > > > > 1. get all form variables into an array > > > > fine > > > > > 2. validate values > > > > Good, but do t

Re: [PHP] Re: PHP MySQL insert

2005-08-19 Thread Ben Ramsey
Please always reply to the list so that others can benefit from the exchange. As it happens, I'm not exactly very knowledgeable about character sets, so someone on the list may be able to offer more help with regard to the problem you're experiencing. -Ben areguera wrote: On 8/19/05, Ben Ra

Re: [PHP] Re: PHP MySQL insert

2005-08-18 Thread Jasper Bryant-Greene
Ben Ramsey wrote: You don't need to convert the values to HTML entities when saving to a database. That's not going to prevent this problem. Furthermore, you don't need to use htmlentities() if you specify your character set properly and all the characters you are outputting are in your chara

Re: [PHP] Re: PHP MySQL insert

2005-08-18 Thread Ben Ramsey
Alain Reguera Delgado wrote: you could try: 1. get all form variables into an array fine 2. validate values Good, but do this step as you put the values into a separate array, don't put all the values into the array first and then validate them later... make sure the input received is in

Re: [PHP] Re: PHP MySQL insert

2005-08-18 Thread Alain Reguera Delgado
you could try: 1. get all form variables into an array 2. validate values 3. convert all values into entities using htmlentities() 4. build sql query (do some tests 'til get it right) 5. execute the built query (with proper db function) by now, commas aren't a problem, they are limited between sq

[PHP] Re: PHP MySQL insert

2005-08-18 Thread Ben Ramsey
Dan Baker wrote: You are looking for the "addslashes" function. It prepares data for database querys: Better yet, don't use addslashes(). Use the escaping function that is specific to the database you're using. In this case, it's mysql_real_escape_string(). This is much better than using add

[PHP] Re: PHP MySQL insert

2005-08-18 Thread Dan Baker
"Jon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Please help with an insert problem. > > Sometimes $data1 could have a comma and that messes up the insert. how do > I > get around that? > > $query = "insert into testtable6 (indx, col1, col2) values (NULL, > '$data1', > '$data

[PHP] Re: PHP MySQL insert

2005-08-18 Thread Satyam
Commas are no problem within strings. You might have an apostrophe, which SQL assumes is the end of the string literal. That was answered by Chris already, I just wanted to clarify the problem. You don't need to insert NULL in indx. If indx allows NULL and has no other default value nor is it

Re: [PHP] mysql insert function

2005-04-18 Thread Richard Lynch
On Sun, April 17, 2005 10:56 am, Dasmeet Singh said: > I regularly need to insert data into MySQL.. and instead of writing > Insert query everytime i wrote this function... and it works well.. > > Please see and tell is it a good idea using this..or there might be > problems with it? It's not a Ba

Re: [PHP] Mysql insert problems

2005-04-16 Thread Burhan Khalid
Andy Pieters wrote: Hi Whilst you are searching the net, you might also want to search for 'sql injection'. This is no joke! Please use the mysql_escape_string on each variable you get from the user side. Use mysql_real_escape_string() instead. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Mysql insert problems

2005-04-15 Thread Philip Hallstrom
On Fri, 15 Apr 2005, Frank Miller wrote: All, I have a form which submits technical requests. It worked fine on an old linux box using Mysql 3 series but recently we switched to windows 2003 server SP1 using Mysql 4.1.10. It was doing this before the service pack. I get the form values and then in

Re: [PHP] Mysql insert problems

2005-04-15 Thread Andy Pieters
Hi Whilst you are searching the net, you might also want to search for 'sql injection'. This is no joke! Please use the mysql_escape_string on each variable you get from the user side. In your example $Email = mysql_escape_string($_POST['Email']); $Phonenumber = mysql_escape_string($_POST['P

Re: [PHP] Mysql insert problems

2005-04-15 Thread John Nichel
Frank Miller wrote: All, I have a form which submits technical requests. It worked fine on an old linux box using Mysql 3 series but recently we switched to windows 2003 server SP1 using Mysql 4.1.10. It was doing this before the service pack. I get the form values and then insert them into a tab

Re: [PHP] Mysql Insert/Update Problem

2004-01-07 Thread John W. Holmes
Haseeb Iqbal wrote: here is what i am trying to do.i have a PHP CLI script > that will open a dbx file extract records from the dbf file > one by one check is the record is already on the linux server > (mysql database). if the record is already on the linux server > then it will update the mysql

Re: [PHP] Mysql Insert/Update Problem

2004-01-07 Thread Haseeb Iqbal
i have index the db properly. what next?? Haseeb - Original Message - From: "Rolf Brusletto" <[EMAIL PROTECTED]> To: "Haseeb Iqbal" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, January 08, 2004 4:04 AM Su

Re: [PHP] Mysql Insert/Update Problem

2004-01-07 Thread Rolf Brusletto
Haseeb - I would look at the indexes that it requires for the select statments, if the db isn't indexed properly, it could be just filesorting on each select(when you query to see if the record is in the database on the mysql server). You can find out by putting explain in front of your select

RE: [PHP] MySQL Insert with Auto-Increment

2003-04-04 Thread Sysadmin
Wonderful! Thanks! -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 8:18 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] MySQL Insert with Auto-Increment use mysql_insert_id(), it keeps its value per connection so you

Re: [PHP] MySQL Insert with Auto-Increment

2003-04-04 Thread Marek Kilimajer
use mysql_insert_id(), it keeps its value per connection so you don't need to worry about anything [EMAIL PROTECTED] wrote: Ok, here's what I have. I want to insert some values into a table with an auto_increment field, but I want to get the Serial of the record I just inserted so I can name

RE: [PHP] Mysql Insert from select problem with php

2002-06-21 Thread John Holmes
MySQL doesn't care about quotes when doing INSERT INTO ... SELECT. It's got to be something you're doing in PHP. Are you using that exact query? mysql> create table list (clientid int, fname varchar(20)); Query OK, 0 rows affected (0.07 sec) mysql> create table list2 (fname varchar(20)); Query O

Re: [PHP] Mysql Insert from select problem with php

2002-06-20 Thread Rasmus Lerdorf
I bet you are double-escaping it. Try without the AddSlashes() call. By default PHP will escape this for you automatically. -Rasmus On Thu, 20 Jun 2002, David McInnis wrote: > After posting this on the MySQL list and getting some feedback we were > able to determine that this was not a flaw w

Re: [PHP] MySQL INSERT concatonating one of my values for seemingly no reason...

2002-05-22 Thread Kevin Stone
Nevermind. Three hours after embarking on my voyage to insanity I finally figured it out. If I type cast the variables as strings the error dissapears. I've never had this problem before though.. so its still a bit of a mystery since the data stored in the variables are most certainly strings a

Re: [PHP] MySQL INSERT

2001-11-18 Thread David Robley
On Mon, 19 Nov 2001 15:19, Justin French wrote: > Thanks David, > > I've skipped off to the manual and done a bit of reading, but i'm a > little confused. The user-added notes have actually clouded the issue > more!! > > It *looks like* from what they're saying, that the number returned may > not

Re: [PHP] MySQL INSERT

2001-11-18 Thread Justin French
Thanks David, I've skipped off to the manual and done a bit of reading, but i'm a little confused. The user-added notes have actually clouded the issue more!! It *looks like* from what they're saying, that the number returned may not be the number that I want, if someone else inserted just afte

RE: [PHP] MySQL INSERT

2001-11-18 Thread Matthew Loff
Did you check the PHP manual? Sounds to me like you just described the mysql_insert_id() function verbatim. http://www.php.net/manual/en/function.mysql-insert-id.php -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 18, 2001 11:21 PM To: php Sub

Re: [PHP] MySQL INSERT

2001-11-18 Thread David Robley
On Mon, 19 Nov 2001 14:51, Justin French wrote: > Hi, > > I'm inserting into a table (as I've done millions of times), and I have > a column called "id", which is an auto incrementing, unique field. > > Since it's auto-increment field, I have no idea what it is at the time > of insert, but I want