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!?

[PHP] mysql insert internal server error 500

2011-05-16 Thread Grega Leskovšek
$ime=$_COOKIE['user']; $dolgF=filesize($filename) INSERT INTO `friendlyCMS`.`log` (`imepriimek`, `clock`, `action`, `onfile`, `filesize`) VALUES ( $ime, CURRENT_TIMESTAMP, 'saved',$filename, $dolgF); What is wrong with this? PS First column of the log table is idlog primary key autoincrement not n

Re: [PHP] PHP MySQL Insert Statements

2010-03-16 Thread Ryan Sun
Always make sure your dynamic sql string in php code are as expected var_dump($sql) before query On Thu, Mar 11, 2010 at 10:13 PM, Martine Osias wrote: > Hi, > > My insert statements on this web page don't execute. The select statements > do work. This tells me that the database connection is wor

Re: [PHP] PHP MySQL Insert Statements

2010-03-16 Thread Jan G.B.
2010/3/12 Martine Osias > Hi, > > My insert statements on this web page don't execute. The select statements > do work. This tells me that the database connection is working. The username > and password are the administrator's. What else could prevent the insert > statements from executing? > > T

Re: [PHP] PHP MySQL Insert Statements

2010-03-11 Thread Kevin Kinsey
Martine Osias wrote: Hi, My insert statements on this web page don't execute. The select statements do work. This tells me that the database connection is working. The username and password are the administrator's. What else could prevent the insert statements from executing? Thank you. M

Re: [PHP] PHP MySQL Insert Statements

2010-03-11 Thread Stephen
Martine Osias wrote: My insert statements on this web page don't execute. The select statements do work. This tells me that the database connection is working. The username and password are the administrator's. What else could prevent the insert statements from executing? Most likely syntax of

Re: [PHP] PHP MySQL Insert Statements

2010-03-11 Thread Bruno Fajardo
2010/3/11 Martine Osias : > Hi, > > My insert statements on this web page don't execute. The select statements > do work. This tells me that the database connection is working. The username > and password are the administrator's. What else could prevent the insert > statements from executing? Woul

[PHP] PHP MySQL Insert Statements

2010-03-11 Thread Martine Osias
Hi, My insert statements on this web page don't execute. The select statements do work. This tells me that the database connection is working. The username and password are the administrator's. What else could prevent the insert statements from executing? Thank you. Martine -- PHP Gene

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

[PHP] MYSQL insert problems

2008-10-17 Thread Frank Stanovcak
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? $value) { echo $key . ' : ' . $value . ''; }; echo ''; }; mysql_close($connection); include('..\VariableReveal

Re: [PHP] PHP MySQL Insert Syntax

2008-04-01 Thread kvigor
Thanks :-) <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Insert is for a new row > > Alter or Update is for an exsisting row > > > > > > /*I'm trying to insert values from an array into MySQL DB but the insert > begins at the last record in the table and not at first record in th

RE: [PHP] PHP MySQL Insert Syntax

2008-04-01 Thread admin
Insert is for a new row Alter or Update is for an exsisting row /*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table. I have added the cellSuffixes column after I already populated 30 records in ot

[PHP] PHP MySQL Insert Syntax

2008-04-01 Thread kvigor
/*I'm trying to insert values from an array into MySQL DB but the insert begins at the last record in the table and not at first record in the table. I have added the cellSuffixes column after I already populated 30 records in other columns*/ Code: foreach($list as $key=>$value) { $query = "IN

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] PHP MySQL insert

2005-08-18 Thread Jordan Miller
besides just escaping your strings, i think you are having a quoting error: http://www.php.net/manual/en/language.types.string.php Commas should not have to be escaped, and indeed the mysql_real_escape_string() function will not escape commas. After escaping your input data with this functi

Re: [PHP] PHP MySQL insert

2005-08-18 Thread Chris
You need to escape the data, so $data1 = mysql_real_escape_string($data1,$rLink); $data2 = mysql_real_escape_string($data2,$rLink); Jon wrote: 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 = "inse

[PHP] PHP MySQL insert

2005-08-18 Thread Jon
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', '$data2')"; mysql_db_query("testdb", $query); -- PHP General Mailing List (http://www.php

Re: [PHP] Re: SOLVED - [PHP] php-mySQL insert problem

2005-08-01 Thread Jack Scott
no prob ;-) On Tue, 2005-08-02 at 02:27 +0200, Adi Zebic wrote: > Jack Scott a écrit : > > Try this: > > $insertQuery = "Insert into TABLE > > ( > > col_one, > > col_two > > )values ( > > '" . $this -> firstName .

[PHP] Re: SOLVED - [PHP] php-mySQL insert problem

2005-08-01 Thread Adi Zebic
Jack Scott a écrit : Try this: $insertQuery = "Insert into TABLE ( col_one, col_two )values ( '" . $this -> firstName . "', '" . $this-> lastName . "' )"; $db =& new

Re: [PHP] php-mySQL insert problem

2005-08-01 Thread Jack Scott
Try this: $insertQuery = "Insert into TABLE ( col_one, col_two )values ( '" . $this -> firstName . "', '" . $this-> lastName . "' )"; $db =& new DB; $res

[PHP] php-mySQL insert problem

2005-08-01 Thread Adi Zebic
Hi, I'm new in php so like usual I have little problem(s). I have "DB" clas who connect to database, select database, query database and so on. I have other class "User" with some "members". exemple: ... var $firstName; var $lastName; ... Then I need to insert created object into mySQL database

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

[PHP] mysql insert function

2005-04-17 Thread Dasmeet Singh
Hi! 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? function db_query($sql) { global $dbh; $result = mys

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

[PHP] Mysql insert problems

2005-04-15 Thread Frank Miller
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 table. Sometimes it wor

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

[PHP] Mysql Insert/Update Problem

2004-01-07 Thread Haseeb Iqbal
here is what i am trying to achieve,i have 2 servers. Win2k and linux. mysql is running on my linux server.now i have quite a lot of that i need to update on linux server from win2k machine. here is what i am trying to do.i have a PHP CLI script that will open a dbx file extract records from the

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

[PHP] MySQL Insert with Auto-Increment

2003-04-04 Thread Sysadmin
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 an image $Serial.jpg. I could just select the serial of the last record entered but what happens (and I know it's unlikely b

[PHP] MySQL Insert Select statement

2002-10-19 Thread dwalker
While reading the MySQL manual for INSERT SELECT, I was not able to determine how to include all 5 fields of one table into another table (containing 100 fields) into SPECIFIC data fields.  Do I need to explicitly list all the fields within the table of 5 fields?  If so, would the statement

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

2002-06-21 Thread John Holmes
ohn Holmes... > -Original Message- > From: David McInnis [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 21, 2002 1:57 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Mysql Insert from select problem with php > > After posting this on the MySQL list and getting some feed

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

[PHP] Mysql Insert from select problem with php

2002-06-20 Thread David McInnis
After posting this on the MySQL list and getting some feedback we were able to determine that this was not a flaw with MySQL. Any ideas from the PHP community? === Can anyone tell me why this does not work? I am using php and mysql. When I do an insert from select into a mysql table I get

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

2002-05-22 Thread Kevin Stone
P-general" <[EMAIL PROTECTED]> Sent: Wednesday, May 22, 2002 4:06 PM Subject: [PHP] MySQL INSERT concatonating one of my values for seemingly no reason... I have an array containing data from a search engine index. The array contains only two values.. "word" and "pages"

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

2002-05-22 Thread Kevin Stone
I have an array containing data from a search engine index. The array contains only two values.. "word" and "pages" which will be stored in a MySQL table. $index[$i]['word'] //contains the keyword. $index[$i]['pages'] // contains a comma delimited list of pages the keyword exists on. If you

Re: [PHP] new to php/mysql - insert not working

2002-03-20 Thread Michael Egan
Robert, I still feel fairly new to this myself but if I find that I'm having problems writing to the database I generally try to echo the query to the page and then test this out directly with the command line prompt directly to the database. At least that way you can test out the query in isola

[PHP] Re: new to php/mysql - insert not working

2002-03-20 Thread Matt Wallace
The actual typo in your code is a trailing comma in your sql statement. > '".$img_group."', '".$display."', )"; Strip out the comma after your last single quote. It's very useful to have CLI access to mysql. Then you could just say, print "QUERY: $query \n"; and instead of executing it, paste

[PHP] new to php/mysql - insert not working

2002-03-20 Thread ROBERT MCPEAK
Can somebody help me with this? The following code gets me "document contains no data." I have done a successfull select from mysql db, but not an insertion. I don't know how to troubleshoot this. Any help is much appreciated. Thanks! -- PHP General Mailing List (http://www.php.net/) To u

[PHP] mySQL INSERT question

2001-12-17 Thread Mike Krisher
I suppose this is more of a SQL question, but how do I insert a row into a table right before the very last row in the table. I am sure there is a way to insert a row other than just at the beginning or end of a table but I can't find the syntax on the mySQL site. Anyone know? » Michael Krisher

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
Subject: [PHP] MySQL INSERT 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 to be

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

[PHP] MySQL INSERT

2001-11-18 Thread Justin French
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 to be able to report it to the screen. "Thankyour for your