Re: [PHP-DB] mysql error...

2007-08-28 Thread Chris

John Pillion wrote:

this is bugging me to no end (no pun intended)...  I am getting the error:

invalid query: You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to 
use near 'Condition, ConstructType, BldgDimensions, Stories, 
CurrentParking, MaxParking, P' at line 1


I cannot find a thing wrong with this...  any ideas what may be the 
problem? All the data types are either int(11) or varchar(50).


"condition" is a reserved word in mysql 5.

http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error...

2007-08-28 Thread Bastien Koert

Condition is a reserved word in mysql...you will need to change the field name
 
bastien> Date: Tue, 28 Aug 2007 18:11:20 -0700> From: [EMAIL PROTECTED]> To: 
php-db@lists.php.net> Subject: [PHP-DB] mysql error...> > this is bugging me to 
no end (no pun intended)... I am getting the error:> > invalid query: You have 
an error in your SQL syntax; check the manual > that corresponds to your MySQL 
server version for the right syntax to > use near 'Condition, ConstructType, 
BldgDimensions, Stories, > CurrentParking, MaxParking, P' at line 1> > I cannot 
find a thing wrong with this... any ideas what may be the > problem? All the 
data types are either int(11) or varchar(50).> > John> > > > INSERT INTO 
tblBuildings (SiteID, Name, Available, MfgWHSqFt, > OfficeSqFt, TotalSqFt, 
MinSqFtAvailable, MaxSqFtAvailable, Condition, > ConstructType, BldgDimensions, 
Stories, CurrentParking, MaxParking, > ParkingSurface, PctOccupied, ClearSpan, 
CeilingMax, PctAC, PctHeated, > FloorType, Sprinkled, DHDoors, DHSize, GLDoors, 
GLSize, RRDoors, RRSize, > CraneNum, CraneSize, RefrigSize) VALUES ('', '[enter 
building name]', > 'Y', '', '', '', '', '', '- Select -', '- Select -', '', '', 
'', '', '- > Select -', '', '', '', '', '', '- Select -', 'Y', '', '', '', '', 
'', > '', '', '', '')> > -- > PHP Database Mailing List (http://www.php.net/)> 
To unsubscribe, visit: http://www.php.net/unsub.php> 
_
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

Re: [PHP-DB] MySQL Error 1366

2007-05-28 Thread Chetanji

Chetanji says,

This may be a typo of yours.
Look at the header...
 
CREATE TABLE `sometableo`

The 'o' is added by mistake?
Blessings,
Chetanji



elk dolk wrote:
> 
>>Hi All,
> 
>>I want to load data from dump file to MySQL table using LOAD DATA INFILE 
>>but there is Error 1366 :
> 
>>mysql> LOAD DATA
>>-> INFILE 'D:/SITE/SOMETABLE.SQL'
>>-> INTO TABLE SOMETABLE
>>-> FIELDS TERMINATED BY ','
>>-> OPTIONALLY ENCLOSED BY ''
>>-> LINES TERMINATED BY ')';
>>ERROR 1366 (HY000): Incorrect integer value:  '--MySQL dump 10.10
>>--
>>--S' for column 'ID' at row 1
> 
> 
> 
>>this is the header of my dump file:
> 
> 
>>DROP TABLE IF EXISTS `sometable`;
>>CREATE TABLE `sometableo` (
>>  `ID` smallint(6) NOT NULL auto_increment,
>>  `Name` varchar(30) NOT NULL,
>>  `title` tinytext,
>>  `description` tinytext,
>>  `cat` tinytext,
>>  PRIMARY KEY  (`ID`)
>>) ENGINE=InnoDB DEFAULT CHARSET=latin1;
> 
> 
>>LOCK TABLES `sometable` WRITE;
>>/*!4 ALTER TABLE `sometable` DISABLE KEYS */;
>>INSERT INTO `sometable` VALUES
>(79,'110_1099','AAA','AA','AAA'),(80,'110_1100','AAA','DFGDFGF','AAA'),
> 
> 
> 
> 
>>any idea for  solving the problem?
> 
> 
>
>>-
>>Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's
on, when. 
>>

-- 
View this message in context: 
http://www.nabble.com/MySQL-Error-1366-tf3830472.html#a10846547
Sent from the Php - Database mailing list archive at Nabble.com.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL Error 1366

2007-05-28 Thread Chris

elk dolk wrote:

Hi All,

I want to load data from dump file to MySQL table using LOAD DATA INFILE 
but there is Error 1366 :


mysql> LOAD DATA
-> INFILE 'D:/SITE/SOMETABLE.SQL'
-> INTO TABLE SOMETABLE
-> FIELDS TERMINATED BY ','
-> OPTIONALLY ENCLOSED BY ''
-> LINES TERMINATED BY ')';
ERROR 1366 (HY000): Incorrect integer value:  '--MySQL dump 10.10
--
--S' for column 'ID' at row 1


LOAD DATA INFILE imports a CSV like file, it can't contain create table 
statements or insert statements.


See the documentation: http://dev.mysql.com/doc/refman/4.1/en/load-data.html


If you have a script with create table & insert statements, use source:

source  (\.)Execute a SQL script file. Takes a file name as an argument.

So

\. filename

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL error...

2004-12-13 Thread Norland, Martin
> -Original Message-
> From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
>   No...  That is just some strange error generated by the cut and
paste.  The "IS NOT NU LL" that is...
>   The other issue with 'tablename'...  I simply typed 'tablename'
in the e-mail because I didn't remember the exact tablename when I was
typing the e-mail.  It does actually provide the name of the table that
the script is working with.

It's very hard to diagnose a problem - unless it's blindingly obvious -
without the exact error, as well as any code which could be contributing
to it.  It's best to cut and paste wherever possible - and if anything
must be 'hidden' to obviously hide it and make note of the replacement.
Just like Johan K# would do.

* K# name has been changed to protect the guilty - in my 'code' it
is typed normally.

Cheers,
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySQL error...

2004-12-10 Thread NIPP, SCOTT V \(SBCSI\)
No...  That is just some strange error generated by the cut and
paste.  The "IS NOT NU LL" that is...
The other issue with 'tablename'...  I simply typed 'tablename'
in the e-mail because I didn't remember the exact tablename when I was
typing the e-mail.  It does actually provide the name of the table that
the script is working with.
Thanks for the feedback.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-Original Message-
From: Norland, Martin [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 2:34 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] MySQL error...


> -Original Message-
> From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
>   I have been using a PHP page to update a database table for a
long time now.  
> Unfortunately, I have noticed that frequently when I perform an update
I get back an error
> saying "Table 'tablename' doesn't exist".  This is becoming more and
more annoying.
[snip]
> $query = "SELECT `id_sys`, atime, gid, shell FROM accounts WHERE atime
IS NOT NU LL AND ctime 
> IS NULL ORDER BY rtime ASC"; $result = mysql_query($query, $Prod) or
die(mysql_error()); ?>


Strange behavior, can't say I've ever heard of/seen it - however...

"IS NOT NU LL" is not, strictly speaking, valid sql.  If that's not just
a weird line wrapping issue - that may point to part of your problem.

If the error you're getting back is literally "Table 'tablename' doesn't
exist" - then you're looking in the wrong code, and somewhere you have
code that says "tablename" instead of "$tablename".  You may want to
grep for "tablename" to try to track that down.

Cheers,
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL error...

2004-12-10 Thread Norland, Martin
> -Original Message-
> From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
>   I have been using a PHP page to update a database table for a
long time now.  
> Unfortunately, I have noticed that frequently when I perform an update
I get back an error
> saying "Table 'tablename' doesn't exist".  This is becoming more and
more annoying.
[snip]
> $query = "SELECT `id_sys`, atime, gid, shell FROM accounts WHERE atime
IS NOT NU LL AND ctime 
> IS NULL ORDER BY rtime ASC"; $result = mysql_query($query, $Prod) or
die(mysql_error()); ?>


Strange behavior, can't say I've ever heard of/seen it - however...

"IS NOT NU LL" is not, strictly speaking, valid sql.  If that's not just
a weird line wrapping issue - that may point to part of your problem.

If the error you're getting back is literally "Table 'tablename' doesn't
exist" - then you're looking in the wrong code, and somewhere you have
code that says "tablename" instead of "$tablename".  You may want to
grep for "tablename" to try to track that down.

Cheers,
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] mysql error and resource ID:

2004-10-18 Thread John Holmes
Stuart Felenstein wrote:
First time setting something like this up. So probably
making some major mistakes.
Anyway I get this message : "mysql_error(Resource id
#2)"
[snip]
echo " . mysql_error($link)";
Read the above line or use an editor that does syntax highlighting. 
Also, you'll want to get the error before you run the rollback() function.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Stuart Felenstein
Yes, actually my apologies to everyone. I figured out
the error.  
So  , yep, I'm down to a problem with the date.
The column is set to date.  I'll go ahead and add the
quotes.

Stuart
--- [EMAIL PROTECTED] wrote:

> Stuart,
> 
> The date has forward slashes. These are not
> integers, right? So put single 
> quotes around the whole date, like '10/15/2004'.
> 
> dave
> 
> 
> 
> 
> 
> Stuart Felenstein <[EMAIL PROTECTED]>
> 
> 10/14/2004 10:02 AM
> 
> 
> 
>  
> 
> To:
> Stuart Felenstein <[EMAIL PROTECTED]>
> cc:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> Subject:
> RE: [PHP-DB] mysql error and resource ID:
> 
> 
> 
> Anyone see something wrong here :
> 
> My error message is :
> 
> "0: 1064: You have an error in your SQL syntax.
> Check
> the manual that corresponds to your MySQL server
> version for the right syntax to use near
> 'd',1,'d',1,1, 31, 33,10/15/2004))' at
> line 5"
> 
> Code:
> 
> $query = "INSERT INTO MainTable
> (RecordID,UserID,other
> fields..)
> values
>
(null,null,'$f1a',$f2a,$f2c,$f2d,$f2e,$f2g,'$f5b','$f3m','$f3n,'$f3e',$f3f,'$f3g',$f3h,$f3i,
> $f3j, $f3k,$f3l))"; //not sure if the double ) is
> //needed though it doesn't make a diff
> begin(); // transaction begins
> $result = mysql_query($query);
> 
> --- Stuart Felenstein <[EMAIL PROTECTED]> wrote:
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Stuart Felenstein
Anyone see something wrong here :

My error message is :

"0: 1064: You have an error in your SQL syntax. Check
the manual that corresponds to your MySQL server
version for the right syntax to use near
'd',1,'d',1,1, 31, 33,10/15/2004))' at
line 5"

Code:

$query = "INSERT INTO MainTable (RecordID,UserID,other
fields..)
values
(null,null,'$f1a',$f2a,$f2c,$f2d,$f2e,$f2g,'$f5b','$f3m','$f3n,'$f3e',$f3f,'$f3g',$f3h,$f3i,
$f3j, $f3k,$f3l))"; //not sure if the double ) is
//needed though it doesn't make a diff
begin(); // transaction begins
$result = mysql_query($query);

--- Stuart Felenstein <[EMAIL PROTECTED]> wrote:

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Graham Cossey

See PHP manual > Chapter 6. Types > Strings

for an explanation of single & double quotes.

>From the doc:

"If the string is enclosed in double-quotes ("), PHP understands more escape
sequences for special characters"

"But the most important feature of double-quoted strings is the fact that
variable names will be expanded."

In your case it would be ' within ".

$query = "INSERT INTO MainTable (RecordID,UserID,.)
values(null,null,'$f1a','$f2a',...)";

Graham.

> -Original Message-
> From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
> Sent: 14 October 2004 15:43
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] mysql error and resource ID:
>
>
> Quote as in "string" or quote as in 'string' ?
> Those two confuse me.
>
> Stuart
> --- [EMAIL PROTECTED] wrote:
>
> > If any of the variables used to insert data are
> > strings ($f1a, $f2a,
> > etc...), you'll need to have quotes around them.
> >
> > dave
> >
> >
> >
> >
> >
> >
> > Stuart Felenstein <[EMAIL PROTECTED]>
> >
> > 10/14/2004 08:26 AM
> >
> >
> >
> >
> >
> > To:
> > Graham Cossey <[EMAIL PROTECTED]>,
> > [EMAIL PROTECTED]
> > cc:
> >
> >
> >
> >
> >
> > Subject:
> > RE: [PHP-DB] mysql error and resource ID:
> >
> >
> >
> > Not much luck here on placing the
> > mysql_error($link);
> > I know the server and database is reachable. So I
> > imagine the error is happening in the query.  I've
> > moved the $link around with no luck.
> >
> > Stuart
> >
> > Revised code below:
> > --- Graham Cossey <[EMAIL PROTECTED]> wrote:
> >
> >  >
> > function begin()
> > {
> > mysql_query("BEGIN");
> > }
> > function commit()
> > {
> > mysql_query("COMMIT");
> > }
> > function rollback()
> > {
> > mysql_query("ROLLBACK");
> > }
> > mysql_connect("myserver","myusername", "mypassword")
> > or die(mysql_error());
> >
> > mysql_select_db("mydatabase") or die(mysql_error());
> >
> > $query = "INSERT INTO MainTable
> > (RecordID,UserID,.)
> > values
> >
> (null,null,$f1a,$f2a,$f2c,$f2d,$f2e,$f2g,$f5b,$f3m,$f3n,$f3e,$f3f,
> $f3g,$f3h,$f3i,$f3j,
> > $f3k,$f3l)";
> > begin(); // transaction begins
> > $result = @mysql_query($query, $link);
> >
> > if(!$result)
> > {
> > rollback(); // transaction rolls back
> > echo "You rolled back ".mysql_error($link);
> > exit;
> > }
> > else
> > {
> > commit(); // transaction is committed
> > echo "your insertion was successful";
> > }
> > ?>
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Stuart Felenstein
Quote as in "string" or quote as in 'string' ?
Those two confuse me.

Stuart
--- [EMAIL PROTECTED] wrote:

> If any of the variables used to insert data are
> strings ($f1a, $f2a, 
> etc...), you'll need to have quotes around them.
> 
> dave
> 
> 
> 
> 
> 
> 
> Stuart Felenstein <[EMAIL PROTECTED]>
> 
> 10/14/2004 08:26 AM
> 
> 
> 
>  
> 
> To:
> Graham Cossey <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED]
> cc:
> 
> 
> 
> 
> 
> Subject:
> RE: [PHP-DB] mysql error and resource ID:
> 
> 
> 
> Not much luck here on placing the
> mysql_error($link);
> I know the server and database is reachable. So I
> imagine the error is happening in the query.  I've
> moved the $link around with no luck. 
> 
> Stuart
> 
> Revised code below:
> --- Graham Cossey <[EMAIL PROTECTED]> wrote:
> 
>  
> function begin()
> {
> mysql_query("BEGIN");
> }
> function commit()
> {
> mysql_query("COMMIT");
> }
> function rollback()
> {
> mysql_query("ROLLBACK");
> }
> mysql_connect("myserver","myusername", "mypassword")
> or die(mysql_error());
> 
> mysql_select_db("mydatabase") or die(mysql_error());
> 
> $query = "INSERT INTO MainTable
> (RecordID,UserID,.)
> values
>
(null,null,$f1a,$f2a,$f2c,$f2d,$f2e,$f2g,$f5b,$f3m,$f3n,$f3e,$f3f,$f3g,$f3h,$f3i,$f3j,
> $f3k,$f3l)";
> begin(); // transaction begins
> $result = @mysql_query($query, $link);
> 
> if(!$result)
> {
> rollback(); // transaction rolls back
> echo "You rolled back ".mysql_error($link);
> exit;
> }
> else
> {
> commit(); // transaction is committed
> echo "your insertion was successful";
> }
> ?>
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Stuart Felenstein
Well believe it or not I got it right finally.
Just used the example from the manual.

Meanwhile, the funny thing is , I think the error
translates back to my original error abut Resource
ID#2
Because not I get : 
Check the manual that corresponds to your MySQL server
version for the right syntax to use near 'id #2).

I think this means the second ID column in the table?

Stuart
--- Graham Cossey <[EMAIL PROTECTED]> wrote:

> Stuart, you need to define $link if you're going to
> use it ;)
> 
> >
> > Not much luck here on placing the
> mysql_error($link);
> > I know the server and database is reachable. So I
> > imagine the error is happening in the query.  I've
> > moved the $link around with no luck.
> >
> > Stuart
> >
> > Revised code below:
> [snip]
> > mysql_connect("myserver","myusername",
> "mypassword") or
> die(mysql_error());
> 
> $link = mysql_connect(...
> 
> >
> > mysql_select_db("mydatabase") or
> die(mysql_error());
> 
> mysql_select_db("mydatabase", $link)...
> 
> >
> > $query = "INSERT INTO MainTable
> > (RecordID,UserID,.)
> > values
> >
>
(null,null,$f1a,$f2a,$f2c,$f2d,$f2e,$f2g,$f5b,$f3m,$f3n,$f3e,$f3f,
> > $f3g,$f3h,$f3i,$f3j,
> > $f3k,$f3l)";
> > begin(); // transaction begins
> > $result = @mysql_query($query, $link);
>  ^ see above
> 
> >
> > if(!$result)
> > {
> > rollback(); // transaction rolls back
> > echo "You rolled back ".mysql_error($link);
>   ^ see
> above
> > exit;
> > }
> > else
> > {
> > commit(); // transaction is committed
> > echo "your insertion was successful";
> > }
> > ?>
> >
> >
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Graham Cossey
Stuart, you need to define $link if you're going to use it ;)

>
> Not much luck here on placing the mysql_error($link);
> I know the server and database is reachable. So I
> imagine the error is happening in the query.  I've
> moved the $link around with no luck.
>
> Stuart
>
> Revised code below:
[snip]
> mysql_connect("myserver","myusername", "mypassword") or
die(mysql_error());

$link = mysql_connect(...

>
> mysql_select_db("mydatabase") or die(mysql_error());

mysql_select_db("mydatabase", $link)...

>
> $query = "INSERT INTO MainTable
> (RecordID,UserID,.)
> values
> (null,null,$f1a,$f2a,$f2c,$f2d,$f2e,$f2g,$f5b,$f3m,$f3n,$f3e,$f3f,
> $f3g,$f3h,$f3i,$f3j,
> $f3k,$f3l)";
> begin(); // transaction begins
> $result = @mysql_query($query, $link);
 ^ see above

>
> if(!$result)
> {
> rollback(); // transaction rolls back
> echo "You rolled back ".mysql_error($link);
  ^ see above
> exit;
> }
> else
> {
> commit(); // transaction is committed
> echo "your insertion was successful";
> }
> ?>
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread dpgirago
If any of the variables used to insert data are strings ($f1a, $f2a, 
etc...), you'll need to have quotes around them.

dave






Stuart Felenstein <[EMAIL PROTECTED]>

10/14/2004 08:26 AM



 

To:
Graham Cossey <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
cc:





Subject:
RE: [PHP-DB] mysql error and resource ID:



Not much luck here on placing the mysql_error($link);
I know the server and database is reachable. So I
imagine the error is happening in the query.  I've
moved the $link around with no luck. 

Stuart

Revised code below:
--- Graham Cossey <[EMAIL PROTECTED]> wrote:



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Stuart Felenstein
Not much luck here on placing the mysql_error($link);
I know the server and database is reachable. So I
imagine the error is happening in the query.  I've
moved the $link around with no luck.  

Stuart

Revised code below:
--- Graham Cossey <[EMAIL PROTECTED]> wrote:



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] mysql error and resource ID:

2004-10-14 Thread Graham Cossey
A few ideas...
[snip]
> Anyway I get this message : "mysql_error(Resource id
> #2)"
>
[snip]
> @mysql_connect("myserver","myusername", "mypassword")
> or die(mysql_error());
>
> @mysql_select_db("mydatabase") or die(mysql_error());
> $link = mysql_connect("myserver", "myusername",
> "mypassword");

Second mysql_connect(), why?
Also, no mysql_select_db for this db connection.

Try removing the @s until it's all working.

[snip]
> begin(); // transaction begins
> $result = @mysql_query($query, $link);

You are now using $link that has not had a mysql_select_db()

>
> if(!$result)
> {
> rollback(); // transaction rolls back
> echo "you rolled back";
> echo " . mysql_error($link)";

echo "You rolled back ".mysql_error($link);

And place this before rollback() or else the mysql statement in rollback()
will probably reset the error.

HTH

Graham

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL error message...

2003-06-30 Thread jeffrey_n_Dyke

mysql knows.  this means your query failed, $command resulted in an invalid
result set.  try adding: or die(mysql_error());  to any call to mysql_query
()so in your code use this:

$result  = mysql_query("$command",$mysqlHandle) or die(mysql_error());
- and -
$resultw  = mysql_query("$commandw",$mysqlHandle) or die(mysql_error());

that will give you all the info you need.

hth
jeff



   
 
  Keith Spiller
 
  <[EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  ve.com>  cc:   Keith Spiller <[EMAIL 
PROTECTED]> 
   Subject:  [PHP-DB] MySQL error 
message...
  06/30/2003 12:47 
 
  PM   
 
   
 
   
 




Hello,

Does anyone know what would cause this message?

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in c:\program files\easyphp\www\bod-rse\bod\menu.php3 on line
49...

Here is the code:

\n";
 $count++;
   }

  // IF MENU VALUE == COMMITTEES
   if ($myrow[2] == "Committees")
   {

   echo "
   Committees
 ";

  $currdate = date("Y-m",time());
  $cdate= explode("-" , $currdate);
  $cyear= $cdate[0];
  $cmonth   = $cdate[1];

  if ($cmonth >=7 AND $cmonth <=12) $fyear  = $cyear + 1;
  else  $fyear  = $cyear;
$fyear2 = $fyear - 1;
$syear  = "$fyear2 - $fyear";

$commandw = "SELECT menuname, type, active, name FROM bod_board_boards
WHERE type='committee' AND active='1' ORDER BY name ASC";
$resultw  = mysql_query("$commandw",$mysqlHandle);
while ($myroww = mysql_fetch_row($resultw))
 {
   if ($myroww[0] !="")
{
   echo "  $myroww[0]";
}
 }

   //echo "  What They
   Do";
   }

   else
   {
 echo "  $myrow[2]\n";
   }
 }

?>


Any help would be unendingly appreciated...


Keith


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL Error

2003-01-29 Thread Jeffrey_N_Dyke

I would check the mysql is running.  can you connect via telnet?

jeff


   
   
Matthew Moldvan
   
, 
[EMAIL PROTECTED]  
yintl.com> cc: 
   
   Subject:     RE: [PHP-DB] MySQL Error   
   
01/29/2003 12:50   
   
PM 
   
   
   
   
   




I would guess something is wrong with the services that are running on your
machine, maybe MySQL isn't on the same machine as your PHP? ... Also, are
you running this on a Windows machine or UNIX?

Matt.

-Original Message-
From: JordanW [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 11:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Error


I'm getting this error message when I try the following code:

$link = mysql_connect("localhost")
   or die("Could not connect");
   print ("Connected successfully");
   mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Error

2003-01-29 Thread Matthew Moldvan
I would guess something is wrong with the services that are running on your
machine, maybe MySQL isn't on the same machine as your PHP? ... Also, are
you running this on a Windows machine or UNIX?

Matt.

-Original Message-
From: JordanW [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 11:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Error


I'm getting this error message when I try the following code:

$link = mysql_connect("localhost")
or die("Could not connect");
print ("Connected successfully");
mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Error

2003-01-28 Thread John Krewson

Just a shot in the dark, but be sure the socket and port settings are 
correct for your setup (whatever that might be since you did not include 
that info in your post) and that mysql is actually running.

Be sure to scour 
http://www.mysql.com/documentation/mysql/bychapter/index.html
especially the section regarding running MySQL on windows.

Sounds like a MySQL setup problem unrelated to PHP.




JordanW wrote:

I'm getting this error message when I try the following code:

$link = mysql_connect("localhost")
or die("Could not connect");
print ("Connected successfully");
mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks





--
John Krewson
Programmer - SWORPS


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] MySQL Error

2003-01-28 Thread Rich Gray
Hi Jordan

Made any recent changes to your network configuration? Can you access other
IP ports OK e.g. http port 80? Do you have any firewall protection on your
PC? Can you access MySQL from the command line OK?

Rich
-Original Message-
From: JordanW [mailto:[EMAIL PROTECTED]]
Sent: 28 January 2003 04:37
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Error


I'm getting this error message when I try the following code:

$link = mysql_connect("localhost")
or die("Could not connect");
print ("Connected successfully");
mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Error

2001-07-10 Thread Benjamin Bleything

ensure that your mysqld is actually running.  Then try running 'mysql 
-hlocalhost -uroot' if it's a new install, or add '-p' at the end if you've set 
a root password.  Alternately, specify another user after -u.

That should help.  I just figured this one out the other day... I had gone so 
far as to install phpMyAdmin solely because I couldn't get the damn mysql client 
to work.

Good Luck,
Ben

>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>list-help: 
>list-unsubscribe: 
>list-post: 
>Delivered-To: mailing list [EMAIL PROTECTED]
>Date: Tue, 10 Jul 2001 22:23:08 +0530
>From: Vivek Misra <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Mime-Version: 1.0
>Content-Transfer-Encoding: 7bit
>Subject: [PHP-DB] MySQL Error
>
>Dear Experts 
>
>When ever i try to run MySQL under linux it gives me following error 
>
>ERROR 2002 : can't connect to local MYSQL server through socket 
'/var/lib/mysql.sock' (111)
>
>what could be possible remedy/rectification of the above ?
>
>million thx in advance 
>
>Vivek Misra 
>
>-- 
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-29 Thread Paul DuBois

At 10:24 AM -0600 6/27/01, Brian Grayless wrote:
>Is anyone familiar with this MySQL error?
>
>"1062: Duplicate entry '127' for key 1"
>I wrote a great bookmark management program that works fine, but everytime I
>insert bookmarks, I insert somewhere over 120 and I start getting this
>error, and it won't add them anymore.  Any suggestions???

You declared your AUTO_INCREMENT column as a TINYINT, which has a range
of -128 to 127.  Use ALTER table to change the column from a TINYINT
to a larger integer type.  You may as well make it UNSIGNED as well,
because you don't use negative numbers in the column.

Something like this:

ALTER TABLE tbl_name MODIFY col_name INT UNSIGNED NOT NULL

>
>Thanks,
>
>B R I A N   G R A Y L E S S
>   Web Administrator
>   Premier Resorts
>   www.premier-resorts.com
>
>P: 435-655-4812
>F: 413-618-1518


-- 
Paul DuBois, [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL Error???

2001-06-29 Thread Jonathan Hilgeman

Hi Brian,
Sounds like you have a tinyint field. Change it to something like int(4) or
bigger, like int(6) or something. TinyInt fields can only hold up to 127, so
when you add another record, the auto-incrementing field you're using cannot
go any higher, so it tries to assign 127, but 127 is already taken. Thats
why you get that error.

- Jonathan

-Original Message-
From: Brian Grayless [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 9:24 AM
To: PHP DB list (E-mail)
Subject: [PHP-DB] MySQL Error???


Is anyone familiar with this MySQL error?

"1062: Duplicate entry '127' for key 1"
I wrote a great bookmark management program that works fine, but everytime I
insert bookmarks, I insert somewhere over 120 and I start getting this
error, and it won't add them anymore.  Any suggestions???

Thanks,

B R I A N   G R A Y L E S S
  Web Administrator
  Premier Resorts
  www.premier-resorts.com

P: 435-655-4812
F: 413-618-1518


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL Error???

2001-06-29 Thread Brian Grayless

Thanks guys. It was all very helpful and worked great!
Brian

-Original Message-
From: Christian Sandfeld [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 3:06 AM
To: 'Brian Grayless'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] MySQL Error???


Brian,

Sounds to me as if the field you have as primary key is set to type
'TINYINT'. TINYINT's 'signed' range accepts values from -128 to 127, when
set to 'unsigned' it accepts values from 0 to 255.

In your place I would concider changing that column to a 'SMALLINT' and set
it to 'unsigned'. This will allow for values from 0 to 65535 (depending ofc.
on how many digits you set as the max display size).

Hope I helped :)

/Christian

-Original Message-
From: Brian Grayless [mailto:[EMAIL PROTECTED]]
Sent: 27. juni 2001 18:24
To: PHP DB list (E-mail)
Subject: [PHP-DB] MySQL Error???


Is anyone familiar with this MySQL error?

"1062: Duplicate entry '127' for key 1"
I wrote a great bookmark management program that works fine, but everytime I
insert bookmarks, I insert somewhere over 120 and I start getting this
error, and it won't add them anymore.  Any suggestions???

Thanks,

B R I A N   G R A Y L E S S
  Web Administrator
  Premier Resorts
  www.premier-resorts.com

P: 435-655-4812
F: 413-618-1518


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL Error???

2001-06-29 Thread Jonathan Hilgeman

I CC-ed the mailing list by accident. Below is my original reply to Brian.

-Original Message-
From: Jonathan Hilgeman 
Sent: Thursday, June 28, 2001 8:14 AM
To: 'Brian Grayless'
Cc: PHP-DB (E-mail)
Subject: RE: [PHP-DB] MySQL Error???


Hi Brian,
Sounds like you have a tinyint field. Change it to something like int(4) or
bigger, like int(6) or something. TinyInt fields can only hold up to 127, so
when you add another record, the auto-incrementing field you're using cannot
go any higher, so it tries to assign 127, but 127 is already taken. Thats
why you get that error.

- Jonathan

-Original Message-
From: Brian Grayless [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 9:24 AM
To: PHP DB list (E-mail)
Subject: [PHP-DB] MySQL Error???


Is anyone familiar with this MySQL error?

"1062: Duplicate entry '127' for key 1"
I wrote a great bookmark management program that works fine, but everytime I
insert bookmarks, I insert somewhere over 120 and I start getting this
error, and it won't add them anymore.  Any suggestions???

Thanks,

B R I A N   G R A Y L E S S
  Web Administrator
  Premier Resorts
  www.premier-resorts.com

P: 435-655-4812
F: 413-618-1518


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL Error???

2001-06-28 Thread Mark Roedel

> -Original Message-
> From: Brian Grayless [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 27, 2001 11:24 AM
> To: PHP DB list (E-mail)
> Subject: [PHP-DB] MySQL Error???
> 
> 
> Is anyone familiar with this MySQL error?
> 
> "1062: Duplicate entry '127' for key 1"
> I wrote a great bookmark management program that works fine, 
> but everytime I insert bookmarks, I insert somewhere over 120
> and I start getting this error, and it won't add them anymore. 
> Any suggestions???

The error message is telling you that you have a "key" field defined
(that is, a field that must uniquely identify a row in your database),
and that you're trying to insert a row that has a value in that field
that you've already used.

Given that everything seems to work until you get to 127, I'd venture to
guess that it might be an autoincrement column of type 'tinyint'.  If
that's the case, consider changing it to a type with a higher capacity
(see http://www.mysql.com/doc/C/o/Column_types.html for more
information).  If not, then perhaps we might be able to provide more
useful suggestions if you could give a little more information about
your database structure and the source for the part of the program
that's causing problems...


---
Mark Roedel ([EMAIL PROTECTED]) | "There cannot be a crisis next week.
Systems Programmer / WebMaster |  My schedule is already full."
 LeTourneau University |   -- Henry Kissinger 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Jason Stechschulte

On Wed, Jun 27, 2001 at 10:24:13AM -0600, Brian Grayless wrote:
> Is anyone familiar with this MySQL error?
> "1062: Duplicate entry '127' for key 1"

The error means you are attempting to put a second record in with the
value of 127.

> I wrote a great bookmark management program that works fine, but everytime I
> insert bookmarks, I insert somewhere over 120 and I start getting this
> error, and it won't add them anymore.  Any suggestions???

I have one idea.  The column is probably a signed tinyint.  tinyints have
a range of -128 to 127.  When you try to put in anything over 127, the
value is out of range, and so apparently tries to reinsert it as 127.

You could change the column to an unsigned tinyint, which would give you
a range of 0 to 255.  Or an unsigned smallint, which gives you a range
of 0 to 65,535.  Just make sure the column is unsigned, since I doubt
you will be storing negative numbers in the column.  This can be done
easily from the mysql client:

alter table your_table modify your_column smallint unsigned;
-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
/* This bit of chicanery makes a unary function followed by
a parenthesis into a function with one argument, highest precedence. */
 -- Larry Wall in toke.c from the perl source code

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Paul Burney

on 6/27/01 9:24 AM, Brian Grayless at [EMAIL PROTECTED] wrote:

> "1062: Duplicate entry '127' for key 1"
> I wrote a great bookmark management program that works fine, but everytime I
> insert bookmarks, I insert somewhere over 120 and I start getting this
> error, and it won't add them anymore.  Any suggestions???

It looks like you set your key column as a TINYINT type rather than say, an
INT.  Try ALTER'ing that column type to INT and see if it works.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster && Open Source Developer
UCLA -> GSE&IS -> ETU
(310) 825-8365
<[EMAIL PROTECTED]>

++



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Saul Diaz Carrillo

Hi
You create a unique index (i think primary) an try to enter a key that is
already in the table.

greetings saul
- Original Message -
From: "Brian Grayless" <[EMAIL PROTECTED]>
To: "PHP DB list (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, June 27, 2001 12:24 PM
Subject: [PHP-DB] MySQL Error???


> Is anyone familiar with this MySQL error?
>
> "1062: Duplicate entry '127' for key 1"
> I wrote a great bookmark management program that works fine, but everytime
I
> insert bookmarks, I insert somewhere over 120 and I start getting this
> error, and it won't add them anymore.  Any suggestions???
>
> Thanks,
>
> B R I A N   G R A Y L E S S
>   Web Administrator
>   Premier Resorts
>   www.premier-resorts.com
>
> P: 435-655-4812
> F: 413-618-1518
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread biorn

Most likely, your id (index, auto-increment field, whatever it is) data type
is tinyint which only goes to 127.


Brian Grayless <[EMAIL PROTECTED]> said:

> Is anyone familiar with this MySQL error?
>
> "1062: Duplicate entry '127' for key 1"
> I wrote a great bookmark management program that works fine, but everytime I
> insert bookmarks, I insert somewhere over 120 and I start getting this
> error, and it won't add them anymore.  Any suggestions???
>
> Thanks,
>
> B R I A N   G R A Y L E S S
>   Web Administrator
>   Premier Resorts
>   www.premier-resorts.com
>
> P: 435-655-4812
> F: 413-618-1518
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Andreas D. Landmark

At 27.06.2001 17:24, Brian Grayless wrote:
>Is anyone familiar with this MySQL error?
>
>"1062: Duplicate entry '127' for key 1"
>I wrote a great bookmark management program that works fine, but everytime I
>insert bookmarks, I insert somewhere over 120 and I start getting this
>error, and it won't add them anymore.  Any suggestions???
>
>Thanks,

It's a code error, not MySQL.

Duplicate entry means that there already is an entry with value '127' for 
key '1'.
Check whether there are some stale bookmarks in your db (use auto_increment
instead).
Also check your code for any errors around the insert statement... 
codesnipplets
would be fine if you want the list to track this down...


-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL Error???

2001-06-28 Thread Christian Sandfeld

Brian,

Sounds to me as if the field you have as primary key is set to type
'TINYINT'. TINYINT's 'signed' range accepts values from -128 to 127, when
set to 'unsigned' it accepts values from 0 to 255.

In your place I would concider changing that column to a 'SMALLINT' and set
it to 'unsigned'. This will allow for values from 0 to 65535 (depending ofc.
on how many digits you set as the max display size).

Hope I helped :)

/Christian

-Original Message-
From: Brian Grayless [mailto:[EMAIL PROTECTED]]
Sent: 27. juni 2001 18:24
To: PHP DB list (E-mail)
Subject: [PHP-DB] MySQL Error???


Is anyone familiar with this MySQL error?

"1062: Duplicate entry '127' for key 1"
I wrote a great bookmark management program that works fine, but everytime I
insert bookmarks, I insert somewhere over 120 and I start getting this
error, and it won't add them anymore.  Any suggestions???

Thanks,

B R I A N   G R A Y L E S S
  Web Administrator
  Premier Resorts
  www.premier-resorts.com

P: 435-655-4812
F: 413-618-1518


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Phil Driscoll

The error is probably caused by you inserting a value (127) nto a unique or 
key field which is identical to one in another record.
-- 
Phil Driscoll

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread Dobromir Velev

Hi,
This error occurs when your auto_increment index field is of type TINYINT.
This field type can accept values form -128 to 127 so you cannot add records
with index value greater than 127.
I recommend you change it to INT(11) UNSIGNED which can accept values from 0
to 4294967295.

If you expect to have more records you may consider using BIGINT type

For more info check the MySQL language reference.

Dobromir Velev


-Original Message-
From: Brian Grayless <[EMAIL PROTECTED]>
To: PHP DB list (E-mail) <[EMAIL PROTECTED]>
Date: Thursday, June 28, 2001 9:29 AM
Subject: [PHP-DB] MySQL Error???


>Is anyone familiar with this MySQL error?
>
>"1062: Duplicate entry '127' for key 1"
>I wrote a great bookmark management program that works fine, but everytime
I
>insert bookmarks, I insert somewhere over 120 and I start getting this
>error, and it won't add them anymore.  Any suggestions???
>
>Thanks,
>
>B R I A N   G R A Y L E S S
>  Web Administrator
>  Premier Resorts
>  www.premier-resorts.com
>
>P: 435-655-4812
>F: 413-618-1518
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL Error???

2001-06-28 Thread Beau Lebens

sounds like your field definition is something like int(2) or something, it
needs to be bigger so that it can handle higher numbers for the unique
primary key :)

// -Original Message-
// From: Brian Grayless [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 June 2001 12:24 AM
// To: PHP DB list (E-mail)
// Subject: [PHP-DB] MySQL Error???
// 
// 
// Is anyone familiar with this MySQL error?
// 
// "1062: Duplicate entry '127' for key 1"
// I wrote a great bookmark management program that works fine, 
// but everytime I
// insert bookmarks, I insert somewhere over 120 and I start 
// getting this
// error, and it won't add them anymore.  Any suggestions???
// 
// Thanks,
// 
// B R I A N   G R A Y L E S S
//   Web Administrator
//   Premier Resorts
//   www.premier-resorts.com
// 
// P: 435-655-4812
// F: 413-618-1518
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL Error???

2001-06-28 Thread CC Zona

In article ,
 [EMAIL PROTECTED] (Brian Grayless) wrote:

> Is anyone familiar with this MySQL error?
> 
> "1062: Duplicate entry '127' for key 1"

You have a unique key (likely the primary key field).  There is already a 
record with value "127" in that field.

> I wrote a great bookmark management program that works fine, but everytime I
> insert bookmarks, I insert somewhere over 120 and I start getting this
> error, and it won't add them anymore.  Any suggestions???

For options, see the MySQL docs on the "insert ignore" and "replace" 
keywords.

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]