Re: MySQL-php UPDATE errors

2001-05-13 Thread FJocelin

Hi,

Try

$saveQuery = UPDATE $table_product SET PROD_PRICE =
 '$value' WHERE PROD_ID = '$key';

instead of

$saveQuery = UPDATE $table_product SET PROD_PRICE =
\$value\ WHERE PROD_ID = \$key\;

Jocelyn Fournier
Presence-PC
www.presence-pc.com


Dans un e-mail daté du 14/05/2001 01:37:19 Paris, Madrid (heure d'été), 
[EMAIL PROTECTED] a écrit :


 Sujet :MySQL-php UPDATE errors
 Date :14/05/2001 01:37:19 Paris, Madrid (heure d'été)
 From:[EMAIL PROTECTED] (M.G. Devney C9803057)
 To:[EMAIL PROTECTED] ('[EMAIL PROTECTED]')
 
 
 
 
 Hi guys,
 
 Hope you can help. I'll give you the source code for my
 overwriteProduct.php3 first I think:
 
 ?php
 if (count($DBHOST)==0)
 include(/home/stud/yrf/bsccs4/c9803057/phpincludes/dbFunctions.php3);
 $dbcnx = myConnect();
 
 echo 1;
 
 while (list ($key, $value) = each ($PROD_PRICE))
 { 
 echo 3;
 $saveQuery = UPDATE $table_product SET PROD_PRICE =
 \$value\ WHERE PROD_ID = \$key\;
 $result=mysql_query($saveQuery);
 echo 4;
 if (! $result) printf (Error: %s
 , mysql_error ());
 };
 ?
 
 This gives the following errors when I run the thing:
 
 134Error: You have an error in your SQL syntax near 'SET PROD_PRICE = 222
 WHERE PROD_ID = 1' at line 1
 34Error: You have an error in your SQL syntax near 'SET PROD_PRICE = 444
 WHERE PROD_ID = 2' at line 1
 34Error: You have an error in your SQL syntax near 'SET PROD_PRICE = 789
 WHERE PROD_ID = 3' at line 1
 34Error: You have an error in your SQL syntax near 'SET PROD_PRICE = 321
 WHERE PROD_ID = 4' at line 1
 
 
 The numbers I'm setting the column/row combos to are spot on ($value  $key
 are fine). Anyone got an idea why it's not working?
 
 Thanks in advance.
 
 Matt Devney
 work: [EMAIL PROTECTED]
 home: [EMAIL PROTECTED]
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 
 
 --- Headers 
 Return-Path: [EMAIL PROTECTED]
 Received: from  rly-za03.mx.aol.com (rly-za03.mail.aol.com [172.31.36.99]) 
 by air-za05.mail.aol.com (v77_r1.36) with ESMTP; Sun, 13 May 2001 19:37:19 
 2000
 Received: from  web.mysql.com (web.mysql.com [192.58.197.162]) by 
 rly-za03.mx.aol.com (v77_r1.36) with ESMTP; Sun, 13 May 2001 19:37:06 -0400
 Received: (qmail 21831 invoked by uid 7797); 13 May 2001 23:32:07 -
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm 
 (http://www.ezmlm.org)
 List-ID: mysql.mysql.com
 Precedence: bulk
 List-Help: mailto:[EMAIL PROTECTED]
 List-Unsubscribe: mailto:[EMAIL PROTECTED]
 
 List-Post: mailto:[EMAIL PROTECTED]
 List-Subscribe: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Received: (qmail 21816 invoked from network); 13 May 2001 23:32:05 -
 Message-ID: [EMAIL PROTECTED]
 From: M.G. Devney C9803057 [EMAIL PROTECTED]
 To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Subject: MySQL-php UPDATE errors
 Date: Mon, 14 May 2001 00:34:01 +0100
 MIME-Version: 1.0
 X-Mailer: Internet Mail Service (5.5.2650.21)
 Content-Type: text/plain
 
 
 





Key_Writes Key_write_requests ???

2001-05-08 Thread FJocelin

Hi,

Mysqladmin shows me :

| Key_write_requests   | 80850 |
| Key_writes   | 112447|

What does it mean, and how could this be possible ?

Thank you,

Jocelyn Fournier
Presence-PC
www.presence-pc.com



Re: char - varchar ?

2001-05-07 Thread FJocelin

Hi, 

Char columns are used with fixed-length type table, whereas varchar are used 
with dynamic table. If you have varchar columns in your table, all char 
columns will be convert to varchar column (you can't have a fixed-length 
table if your table contain varchar, blob or text field).

Here are the property of static table :


All CHAR, NUMERIC, and DECIMAL columns are space-padded to the column width. 
Very quick. 
Easy to cache. 
Easy to reconstruct after a crash, because records are located in fixed 
positions. 
Doesn't have to be reorganized (with myisamchk) unless a huge number of 
records are deleted and you want to return free disk space to the operating 
system. 
Usually requires more disk space than dynamic tables. 


Jocelyn Fournier
Presence-PC
www.presence-pc.com

Dans un e-mail daté du 07/05/2001 23:42:12 Paris, Madrid (heure d'été), 
[EMAIL PROTECTED] a écrit :


 Sujet :char - varchar ?
 Date :07/05/2001 23:42:12 Paris, Madrid (heure d'été)
 From:[EMAIL PROTECTED] (Alec Solway)
 To:[EMAIL PROTECTED]
 
 
 
 
 Hi,
 
 In various create table statements char columns are converted to varchar.. 
 I was wondering why this was happening. Here's an example:
 
 CREATE TABLE realtors(name VARCHAR(255) not null, address VARCHAR(255) not 
 null, city VARCHAR(255) not null, state CHAR(2) not null, country CHAR(2) 
 not null, zip CHAR(5) not null, phone VARCHAR(50) not null, cell 
 VARCHAR(50) not null, fax VARCHAR(50) not null, nvio VARCHAR(25) not null, 
 estlead CHAR(5) not null, servicearea VARCHAR(255) not null);
 Query OK, 0 rows affected (0.11 sec)
 
 Here, zip and estlead have been converted to varchar(5).
 
 
 Thanks.
 Alec 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 
 
 
 --- Headers 
 Return-Path: [EMAIL PROTECTED]
 Received: from  rly-yh05.mx.aol.com (rly-yh05.mail.aol.com [172.18.147.37]) 
 by air-yh03.mail.aol.com (v77_r1.36) with ESMTP; Mon, 07 May 2001 17:42:12 
 2000
 Received: from  web.mysql.com (web.mysql.com [192.58.197.162]) by 
 rly-yh05.mx.aol.com (v77_r1.36) with ESMTP; Mon, 07 May 2001 17:41:38 -0400
 Received: (qmail 17223 invoked by uid 7797); 7 May 2001 21:36:06 -
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm 
 (http://www.ezmlm.org)
 List-ID: mysql.mysql.com
 Precedence: bulk
 List-Help: mailto:[EMAIL PROTECTED]
 List-Unsubscribe: mailto:[EMAIL PROTECTED]
 
 List-Post: mailto:[EMAIL PROTECTED]
 List-Subscribe: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Received: (qmail 17209 invoked from network); 7 May 2001 21:36:04 -
 Message-Id: [EMAIL PROTECTED]
 X-Sender: [EMAIL PROTECTED]
 X-Mailer: QUALCOMM Windows Eudora Version 5.0.2
 Date: Mon, 07 May 2001 16:38:40 -0500
 To: [EMAIL PROTECTED]
 From: Alec Solway [EMAIL PROTECTED]
 Subject: char - varchar ?
 Mime-Version: 1.0
 Content-Type: text/plain; charset=us-ascii; format=flowed
 
 
 





REPLACE DELAYED bug with MySQL 3.23.36

2001-03-29 Thread FJocelin

Hi ! 

I notice a bug with MySQL 3.23.36 with REPLACE DELAYED which crash my MyISAM 
tables.
The problem was present in MySQL 3.23.34, but not in 3.23.33 nor 3.23.35.
The bug occurs randomly and makes MySQL restart...
With REPLACE instead of REPLACE DELAYED, there seems to be no problem.

Here is what MyISAMCHK report :

Checking MyISAM file: online
Data records:  96   Deleted blocks:  79
myisamchk: warning: Table is marked as crashed
- check file-size
- check key delete-chain
- check record delete-chain
myisamchk: error: record delete-link-chain corrupted
- check index reference
- check data record references index: 1
myisamchk: error: Found key at page 2048 that points to record outside 
datafile
MyISAM-table 'online' is corrupted


Here is what I use with PHP :

mysql_query("REPLACE DELAYED INTO online (pseudo,date,cat,forum) VALUES 
('$user','$time','$cat','$site')",$dbh) or die( "Erreur 1:".mysql_error());
}
else
{
mysql_query("REPLACE DELAYED INTO guest (pseudo,date,forum) VALUES 
('$REMOTE_ADDR','$time','$site')",$dbh) or die( "Erreur:".mysql_error());
}
$timeold=$time-120;
@mysql_query("DELETE FROM online WHERE date  $timeold",$dbh) or die( 
"Erreur:".mysql_error());
@mysql_query("DELETE FROM guest WHERE date  $timeold",$dbh) or die( 
"Erreur:".mysql_error());

Now the online and guest table structure :

CREATE TABLE online (pseudo char(35) NOT NULL,date int(11) unsigned DEFAULT 
'0' NOT NULL,cat tinyint(4) unsigned DEFAULT '0' NOT NULL,forum char(35) NOT 
NULL,PRIMARY KEY (pseudo),KEY date (date));

CREATE TABLE guest (pseudo char(35) NOT NULL,date int(11) unsigned DEFAULT 
'0' NOT NULL,forum char(35) NOT NULL,PRIMARY KEY (pseudo),KEY date (date));


If I have time I'll try to make a stack trace report...


--
Jocelyn Fournier
Presence-PC
www.presence-pc.com 



REPLACE DELAYED bug with MySQL 3.23.36

2001-03-29 Thread FJocelin

Hi ! 

I notice a bug with MySQL 3.23.36 with REPLACE DELAYED which crash my MyISAM 
tables.
The problem was present in MySQL 3.23.34, but not in 3.23.33 nor 3.23.35.
The bug occurs randomly and makes MySQL restart...
With REPLACE instead of REPLACE DELAYED, there seems to be no problem.

Here is what MyISAMCHK report :

Checking MyISAM file: online
Data records:  96   Deleted blocks:  79
myisamchk: warning: Table is marked as crashed
- check file-size
- check key delete-chain
- check record delete-chain
myisamchk: error: record delete-link-chain corrupted
- check index reference
- check data record references index: 1
myisamchk: error: Found key at page 2048 that points to record outside 
datafile
MyISAM-table 'online' is corrupted


Here is what I use with PHP :

mysql_query("REPLACE DELAYED INTO online (pseudo,date,cat,forum) VALUES 
('$user','$time','$cat','$site')",$dbh) or die( "Erreur 1:".mysql_error());
}
else
{
mysql_query("REPLACE DELAYED INTO guest (pseudo,date,forum) VALUES 
('$REMOTE_ADDR','$time','$site')",$dbh) or die( "Erreur:".mysql_error());
}
$timeold=$time-120;
@mysql_query("DELETE FROM online WHERE date  $timeold",$dbh) or die( 
"Erreur:".mysql_error());
@mysql_query("DELETE FROM guest WHERE date  $timeold",$dbh) or die( 
"Erreur:".mysql_error());

Now the online and guest table structure :

CREATE TABLE online (pseudo char(35) NOT NULL,date int(11) unsigned DEFAULT 
'0' NOT NULL,cat tinyint(4) unsigned DEFAULT '0' NOT NULL,forum char(35) NOT 
NULL,PRIMARY KEY (pseudo),KEY date (date));

CREATE TABLE guest (pseudo char(35) NOT NULL,date int(11) unsigned DEFAULT 
'0' NOT NULL,forum char(35) NOT NULL,PRIMARY KEY (pseudo),KEY date (date));


If I have time I'll try to make a stack trace report...


--
Jocelyn Fournier
Presence-PC
www.presence-pc.com