- Original Message -
> From: "crocket"
>
> I had 19 rows in series table. And when I tried inserting the 20th
> row, the auto_increment value suddenly increased from 20 to 32, and
> the new row has 20 as series_id.
The first thing that comes to mind, is transactions that insert, but then
Below is the definition of the table with the problem.
CREATE TABLE `series` (
`series_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(200) NOT NULL,
PRIMARY KEY (`series_id`)
) ENGINE=InnoDB
I had 19 rows in series table. And when I tried inserting the 20th
row, the auto_incr
Am 20.09.2011 01:23, schrieb Dotan Cohen:
> On Tue, Sep 20, 2011 at 01:48, Reindl Harald wrote:
>> i would use a samll class holding the db-connection with
>> insert/update-methods
>> pass the whole record-array, lokk what field types are used in the table
>> and use intval(), doubleval() or my
On Tue, Sep 20, 2011 at 01:48, Reindl Harald wrote:
> i would use a samll class holding the db-connection with insert/update-methods
> pass the whole record-array, lokk what field types are used in the table
> and use intval(), doubleval() or mysql_real_escape-String
>
By the way, the database co
On Tue, Sep 20, 2011 at 01:48, Reindl Harald wrote:
> i would use a samll class holding the db-connection with insert/update-methods
> pass the whole record-array, lokk what field types are used in the table
> and use intval(), doubleval() or mysql_real_escape-String
>
> so you never write "insert
On Tue, Sep 20, 2011 at 02:09, Hank wrote:
>>
>> I want to be sure that all variables in the query are escaped. I don't
>> trust myself or anyone else to do this to every variable right before
>> the query:
>> $someVar=mysql_real_escape_string($someVar);
>>
>
> But you're doing exactly that right
>
>
> I want to be sure that all variables in the query are escaped. I don't
> trust myself or anyone else to do this to every variable right before
> the query:
> $someVar=mysql_real_escape_string($someVar);
>
>
But you're doing exactly that right before the query anyway with:
$M[username]=mysql_
Am 20.09.2011 00:39, schrieb Dotan Cohen:
> On Tue, Sep 20, 2011 at 01:11, Hank wrote:
>> Best of both worlds:
>>> $username=$_POST['username'];
>>> // do some stuff with username here
>>> $M=array(); // Array of things to be inserted into MySQL
>>> $M[username]=mysql_real_escape_string($userna
On Tue, Sep 20, 2011 at 01:11, Hank wrote:
> Best of both worlds:
>> $username=$_POST['username'];
>> // do some stuff with username here
>> $M=array(); // Array of things to be inserted into MySQL
>> $M[username]=mysql_real_escape_string($username); // Everything that
>> goes into $M is escaped
Best of both worlds:
> $username=$_POST['username'];
> // do some stuff with username here
> $M=array(); // Array of things to be inserted into MySQL
> $M[username]=mysql_real_escape_string($username); // Everything that
> goes into $M is escaped
> $query="INSERT INTO table (username) VALUES ('{$M
Dear MySQL users,
MySQL Server 5.1.59, a new version of the popular Open Source
Database Management System, has been released. MySQL 5.1.59 is
recommended for use on production systems.
For an overview of what's new in MySQL 5.1, please see
http://dev.mysql.com/doc/refman/5.1/en/mysql-nutshel
On Mon, Sep 19, 2011 at 18:11, Reindl Harald wrote:
> it is not because it is clear that it is sanitized instead hope and pray
> thousands of layers somewhere else did it - for a inline-query the best
> solution, if you are using a framework you will never have the "insert into"
> at this place!
>
- Original Message -
> From: "Hank"
>
> I'm trying to rebuild an index after disabling all keys using
> myisamchk and adding all 144 million records, so there is no current index on
> the
> table.
Ahhh... I didn't realise that.
> But in order to create the index, mysql has to do a fu
Thank you very much for all the insightful advice. I will keep the
separated.
2011/9/19 Jerry Schwartz
> >-Original Message-
> >From: Richard Reina [mailto:gatorre...@gmail.com]
> >Sent: Monday, September 19, 2011 9:55 AM
> >To: mysql@lists.mysql.com
> >Subject: table design question
> >
Am 19.09.2011 16:55, schrieb Hank:
>>
>> what ugly style - if it is not numeric and you throw it to the database
>> you are one of the many with a sql-injection because if you are get
>> ivalid values until there you have done no sanitize before and do not here
>>
>>
> It's a matter of opinion.
I would design three tables:
Table1 (states):
ID, name, abbreviation
Table2 (state_item):
ID, state_id (from states), item_id (from item_type), item_value (varchar)
Table3 (item_type):
ID, item_name
Into the item_type table you can insert:
Nick Name
Motto
Name origin
Facts
SomeOtherDataPoint
S
>
> what ugly style - if it is not numeric and you throw it to the database
> you are one of the many with a sql-injection because if you are get
> ivalid values until there you have done no sanitize before and do not here
>
>
It's a matter of opinion. I never said the data wasn't sanitized (it is
>
> > Exactly - I can't create an index on the table until I remove the
> > duplicate records.
>
> I was under the impression you were seeing this during a myisamchk run -
> which indicates you should *already* have a key on that field. Or am I
> interpreting that wrong?
>
>
I'm trying to rebuild a
>-Original Message-
>From: Richard Reina [mailto:gatorre...@gmail.com]
>Sent: Monday, September 19, 2011 9:55 AM
>To: mysql@lists.mysql.com
>Subject: table design question
>
>I want to create a US geography database. So far I have categories such as
>state nick names (some states have more
I want to create a US geography database. So far I have categories such as
state nick names (some states have more than one), state mottos (text 25 to
150 characters), state name origins (100-300 characters), state "trivial
facts", entry into union. My question is; would it be better to keep at
le
- Original Message -
> From: "Hank"
>
> Exactly - I can't create an index on the table until I remove the
> duplicate records.
I was under the impression you were seeing this during a myisamchk run - which
indicates you should *already* have a key on that field. Or am I interpreting
t
On Mon, Sep 19, 2011 at 7:19 AM, Johan De Meersman wrote:
> - Original Message -
> > From: "Hank"
> >
> > While running a -rq on a large table, I got the following error:
> >
> > myisamchk: warning: Duplicate key for record at 54381140 against
> > record at 54380810
> >
> > How do I f
- Original Message -
> From: "Hank"
>
> While running a -rq on a large table, I got the following error:
>
> myisamchk: warning: Duplicate key for record at 54381140 against
> record at 54380810
>
> How do I find which records are duplicated (without doing the typical
> self-join o
On Mon, Sep 19, 2011 at 07:47, Reindl Harald wrote:
> what ugly style - if it is not numeric and you throw it to the database
> you are one of the many with a sql-injection because if you are get
> ivalid values until there you have done no sanitize before and do not here
>
> $sql="INSERT into tab
24 matches
Mail list logo