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!?
$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
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
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
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
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
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
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
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
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
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
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
/*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
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
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
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
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
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
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
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
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
"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
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
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
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
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
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 .
Jack Scott a écrit :
Try this:
$insertQuery = "Insert into TABLE
(
col_one,
col_two
)values (
'" . $this -> firstName . "',
'" . $this-> lastName . "'
)";
$db =& new
Try this:
$insertQuery = "Insert into TABLE
(
col_one,
col_two
)values (
'" . $this -> firstName . "',
'" . $this-> lastName . "'
)";
$db =& new DB;
$res
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
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
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
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/)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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"
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
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
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
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
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
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
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
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
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
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
59 matches
Mail list logo