php-windows Digest 22 May 2007 13:38:14 -0000 Issue 3234
Topics (messages 27920 through 27929):
Bug??? "Duplicate entry '255' for key 1 " on auto increment
27920 by: Mark Abrams
27921 by: Dale Attree
27922 by: bedul
27923 by: Mark Abrams
PHP generated Excel Spreadsheets
27924 by: Dale Attree
27925 by: bedul
27926 by: Dale Attree
27927 by: Aleksandar Vojnovic
Mysql and Textarea
27928 by: sam rumaizan
27929 by: Mikael Grön
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi All,
I have a table problem with "Duplicate entry '255' for key 1 " when any of
my auto increment rowID fields reaches 255
I have installed PHP Version 5.1.2 and mySQL 5.0.11-beta on Win XP Pro.
Each table in my DB that uses an auto increment for rowID fails at the 255th
record insert.
I have redefined the field: TINYINT, INT, VARCHAR, ... Same problem on
several files. They all work OK until I hit #255
Is this a bug? Have I defined my table improperly? Is there a fix?
TIA,
Mark
Here is my table defn:
$query = "CREATE TABLE $table_name (
rowID INT UNSIGNED NOT NULL AUTO_INCREMENT,
category VARCHAR(25) NOT NULL,
trans_type VARCHAR(8) NOT NULL,
PRIMARY KEY (rowID))";
--- End Message ---
--- Begin Message ---
Set the length of rowID to 11, leave type as INT.
-----Original Message-----
From: Mark Abrams [mailto:[EMAIL PROTECTED]
Sent: 22 May 2007 06:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Bug??? "Duplicate entry '255' for key 1 " on auto
increment
Hi All,
I have a table problem with "Duplicate entry '255' for key 1 " when any of
my auto increment rowID fields reaches 255
I have installed PHP Version 5.1.2 and mySQL 5.0.11-beta on Win XP Pro.
Each table in my DB that uses an auto increment for rowID fails at the 255th
record insert.
I have redefined the field: TINYINT, INT, VARCHAR, ... Same problem on
several files. They all work OK until I hit #255
Is this a bug? Have I defined my table improperly? Is there a fix?
TIA,
Mark
Here is my table defn:
$query = "CREATE TABLE $table_name (
rowID INT UNSIGNED NOT NULL AUTO_INCREMENT,
category VARCHAR(25) NOT NULL,
trans_type VARCHAR(8) NOT NULL,
PRIMARY KEY (rowID))";
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
***********************************************************************************************
The information contained in this e-mail is confidential and may be subject to
legal privilege.
Access to this e-mail by anyone other than the intended recipient is
unauthorised.
If you are not the intended recipient you must not use, copy, distribute or
disclose the e-mail or any part of its contents or take any action in reliance
on it. If you have received this e-mail in error, please notify us immediately
by e-mail ([EMAIL PROTECTED]) or telephone (+27 11 265 4200).
This message is free of all known viruses. It has been screened for viruses by
Blockmail.
***********************************************************************************************
--- End Message ---
--- Begin Message ---
$query = "CREATE TABLE $table_name (
rowID INT(11) NOT NULL AUTO_INCREMENT,
category VARCHAR(25) NOT NULL,
trans_type VARCHAR(8) NOT NULL,
PRIMARY KEY (rowID))";
try above.. thx to dale
----- Original Message -----
From: "Dale Attree" <[EMAIL PROTECTED]>
To: "'Mark Abrams'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2007 11:59 AM
Subject: RE: [PHP-WIN] Bug??? "Duplicate entry '255' for key 1 " on auto
increment
> Set the length of rowID to 11, leave type as INT.
>
> -----Original Message-----
> From: Mark Abrams [mailto:[EMAIL PROTECTED]
> Sent: 22 May 2007 06:52 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Bug??? "Duplicate entry '255' for key 1 " on auto
> increment
>
> Hi All,
>
> I have a table problem with "Duplicate entry '255' for key 1 " when any of
> my auto increment rowID fields reaches 255
>
> I have installed PHP Version 5.1.2 and mySQL 5.0.11-beta on Win XP Pro.
>
> Each table in my DB that uses an auto increment for rowID fails at the
255th
>
> record insert.
> I have redefined the field: TINYINT, INT, VARCHAR, ... Same problem on
> several files. They all work OK until I hit #255
>
> Is this a bug? Have I defined my table improperly? Is there a fix?
>
> TIA,
> Mark
>
> Here is my table defn:
> $query = "CREATE TABLE $table_name (
> rowID INT UNSIGNED NOT NULL AUTO_INCREMENT,
> category VARCHAR(25) NOT NULL,
> trans_type VARCHAR(8) NOT NULL,
> PRIMARY KEY (rowID))";
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
>
****************************************************************************
*******************
> The information contained in this e-mail is confidential and may be
subject to legal privilege.
> Access to this e-mail by anyone other than the intended recipient is
unauthorised.
>
> If you are not the intended recipient you must not use, copy, distribute
or disclose the e-mail or any part of its contents or take any action in
reliance on it. If you have received this e-mail in error, please notify us
immediately by e-mail ([EMAIL PROTECTED]) or telephone (+27
11 265 4200).
> This message is free of all known viruses. It has been screened for
viruses by Blockmail.
>
****************************************************************************
*******************
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Problem solved! Thank you.
""Dale Attree"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Set the length of rowID to 11, leave type as INT.
>
> -----Original Message-----
> From: Mark Abrams [mailto:[EMAIL PROTECTED]
> Sent: 22 May 2007 06:52 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Bug??? "Duplicate entry '255' for key 1 " on auto
> increment
>
> Hi All,
>
> I have a table problem with "Duplicate entry '255' for key 1 " when any of
> my auto increment rowID fields reaches 255
>
> I have installed PHP Version 5.1.2 and mySQL 5.0.11-beta on Win XP Pro.
>
> Each table in my DB that uses an auto increment for rowID fails at the
> 255th
>
> record insert.
> I have redefined the field: TINYINT, INT, VARCHAR, ... Same problem on
> several files. They all work OK until I hit #255
>
> Is this a bug? Have I defined my table improperly? Is there a fix?
>
> TIA,
> Mark
>
> Here is my table defn:
> $query = "CREATE TABLE $table_name (
> rowID INT UNSIGNED NOT NULL AUTO_INCREMENT,
> category VARCHAR(25) NOT NULL,
> trans_type VARCHAR(8) NOT NULL,
> PRIMARY KEY (rowID))";
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
> ***********************************************************************************************
> The information contained in this e-mail is confidential and may be
> subject to legal privilege.
> Access to this e-mail by anyone other than the intended recipient is
> unauthorised.
>
> If you are not the intended recipient you must not use, copy, distribute
> or disclose the e-mail or any part of its contents or take any action in
> reliance on it. If you have received this e-mail in error, please notify
> us immediately by e-mail ([EMAIL PROTECTED]) or telephone
> (+27 11 265 4200).
> This message is free of all known viruses. It has been screened for
> viruses by Blockmail.
> ***********************************************************************************************
>
--- End Message ---
--- Begin Message ---
Using PEAR :: Spreadsheet_Excel_Writer
I am having compatibility issues with Excel 2007.
Has anyone else experienced issues and got solutions?
________________________
Dale Attree
PHP Developer
Jacklin Enterprises
tel: +27 11 265 4282
mobile: +27 83 407 2911
fax: +27 11 314 2984
***********************************************************************************************
The information contained in this e-mail is confidential and may be subject to
legal privilege.
Access to this e-mail by anyone other than the intended recipient is
unauthorised.
If you are not the intended recipient you must not use, copy, distribute or
disclose the e-mail or any part of its contents or take any action in reliance
on it. If you have received this e-mail in error, please notify us immediately
by e-mail ([EMAIL PROTECTED]) or telephone (+27 11 265 4200).
This message is free of all known viruses. It has been screened for viruses by
Blockmail.
***********************************************************************************************
--- End Message ---
--- Begin Message ---
nope.. there were something strange with those excel 2007..
but i always use csv instead excel 2007.. well.. can u share us your script
related to above?
----- Original Message -----
From: "Dale Attree" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2007 3:47 PM
Subject: [PHP-WIN] PHP generated Excel Spreadsheets
> Using PEAR :: Spreadsheet_Excel_Writer
>
>
>
> I am having compatibility issues with Excel 2007.
>
>
>
> Has anyone else experienced issues and got solutions?
>
>
>
> ________________________
>
> Dale Attree
>
> PHP Developer
>
> Jacklin Enterprises
>
> tel: +27 11 265 4282
>
> mobile: +27 83 407 2911
> fax: +27 11 314 2984
>
>
>
>
>
>
>
>
****************************************************************************
*******************
> The information contained in this e-mail is confidential and may be
subject to legal privilege.
> Access to this e-mail by anyone other than the intended recipient is
unauthorised.
>
> If you are not the intended recipient you must not use, copy, distribute
or disclose the e-mail or any part of its contents or take any action in
reliance on it. If you have received this e-mail in error, please notify us
immediately by e-mail ([EMAIL PROTECTED]) or telephone (+27
11 265 4200).
> This message is free of all known viruses. It has been screened for
viruses by Blockmail.
>
****************************************************************************
*******************
>
>
--- End Message ---
--- Begin Message ---
I think csv is the way I will have to go.
I think Microsoft may have migrated from the BIFF5 standard with Excel 2007
and that is what is causing this problem.
Unfortunately, the script is database driven and also a company report, so I
am unable to share it.
-----Original Message-----
From: bedul [mailto:[EMAIL PROTECTED]
Sent: 22 May 2007 12:16 PM
To: Dale Attree
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] PHP generated Excel Spreadsheets
nope.. there were something strange with those excel 2007..
but i always use csv instead excel 2007.. well.. can u share us your script
related to above?
----- Original Message -----
From: "Dale Attree" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2007 3:47 PM
Subject: [PHP-WIN] PHP generated Excel Spreadsheets
> Using PEAR :: Spreadsheet_Excel_Writer
>
>
>
> I am having compatibility issues with Excel 2007.
>
>
>
> Has anyone else experienced issues and got solutions?
>
>
>
> ________________________
>
> Dale Attree
>
> PHP Developer
>
> Jacklin Enterprises
>
> tel: +27 11 265 4282
>
> mobile: +27 83 407 2911
> fax: +27 11 314 2984
>
>
>
>
>
>
>
>
****************************************************************************
*******************
> The information contained in this e-mail is confidential and may be
subject to legal privilege.
> Access to this e-mail by anyone other than the intended recipient is
unauthorised.
>
> If you are not the intended recipient you must not use, copy, distribute
or disclose the e-mail or any part of its contents or take any action in
reliance on it. If you have received this e-mail in error, please notify us
immediately by e-mail ([EMAIL PROTECTED]) or telephone (+27
11 265 4200).
> This message is free of all known viruses. It has been screened for
viruses by Blockmail.
>
****************************************************************************
*******************
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
***********************************************************************************************
The information contained in this e-mail is confidential and may be subject to
legal privilege.
Access to this e-mail by anyone other than the intended recipient is
unauthorised.
If you are not the intended recipient you must not use, copy, distribute or
disclose the e-mail or any part of its contents or take any action in reliance
on it. If you have received this e-mail in error, please notify us immediately
by e-mail ([EMAIL PROTECTED]) or telephone (+27 11 265 4200).
This message is free of all known viruses. It has been screened for viruses by
Blockmail.
***********************************************************************************************
--- End Message ---
--- Begin Message ---
There is another simple "crude" way of accomplishing the same task which
works for me. Example:
<?php
$xls = '
<table>
<tr>
<td>column 1</td><td>column 2</td>
</tr>
</table>';
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="export.xls"');
header('Cache-Control: max-age=5, must-revalidate');
header('Pragma: public');
print $xls;
?>
Dale Attree wrote:
I think csv is the way I will have to go.
I think Microsoft may have migrated from the BIFF5 standard with Excel 2007
and that is what is causing this problem.
Unfortunately, the script is database driven and also a company report, so I
am unable to share it.
-----Original Message-----
From: bedul [mailto:[EMAIL PROTECTED]
Sent: 22 May 2007 12:16 PM
To: Dale Attree
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] PHP generated Excel Spreadsheets
nope.. there were something strange with those excel 2007..
but i always use csv instead excel 2007.. well.. can u share us your script
related to above?
----- Original Message -----
From: "Dale Attree" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2007 3:47 PM
Subject: [PHP-WIN] PHP generated Excel Spreadsheets
Using PEAR :: Spreadsheet_Excel_Writer
I am having compatibility issues with Excel 2007.
Has anyone else experienced issues and got solutions?
________________________
Dale Attree
PHP Developer
Jacklin Enterprises
tel: +27 11 265 4282
mobile: +27 83 407 2911
fax: +27 11 314 2984
****************************************************************************
*******************
The information contained in this e-mail is confidential and may be
subject to legal privilege.
Access to this e-mail by anyone other than the intended recipient is
unauthorised.
If you are not the intended recipient you must not use, copy, distribute
or disclose the e-mail or any part of its contents or take any action in
reliance on it. If you have received this e-mail in error, please notify us
immediately by e-mail ([EMAIL PROTECTED]) or telephone (+27
11 265 4200).
This message is free of all known viruses. It has been screened for
viruses by Blockmail.
****************************************************************************
*******************
--- End Message ---
--- Begin Message ---
I'm just a php beginner.
So please be patient with my stupid questions.
What am I missing in this code that causing the function cant update the
textarea?
Update button erase the old information from mysql database and replace it
with nothing. Basically it cant read what is inside the Textarea box. Why??
Read the highlighted code.
<?php
if (isset($_REQUEST['save_assign_engineer'])) {
$id = (int) $_REQUEST['save_assign_engineer'];
$job_title =
mysql_real_escape_string($_REQUEST['Assign_Engineer'][' .$id . ']['Job_Title']);
$sql = "
UPDATE `lo_data`
SET `Job_Title` = '" . $job_title . "'
WHERE `ID` = " . $id;
mysql_query($sql);
}
if (isset($_POST["R"])) {
$result = mysql_query("SELECT * FROM lo_data WHERE Assign_Engineer
='".$_POST["R"]."'");
}
while($row = mysql_fetch_array($result))
{
echo "<TBODY>";
echo "<TR VALIGN=\"TOP\" ALIGN=\"CENTER\">";
echo "<TD>{$row['ID']}</TD>";
echo "<TD>{$row['Ref_No']}</TD>";
echo '<TD> <P><TEXTAREA NAME="Assign_Engineer[' . $row['ID'] .
'][Job_Title]" ROWS="10"
COLS="40">'.$row['Job_Title'] .'</TEXTAREA>';
echo " <BR />";
echo '<button type="submit" name="save_assign_engineer" value="' .
$row['ID'] . '" />Updaet data</button>
';
echo "<TD>{$row['Category']}</TD>";
echo "<TD>{$row['Assign_Engineer']}</TD>";
echo "<TD>{$row['Date_Received']}</TD>";
echo "<TD>{$row['Date_Required']}</TD>";
echo "<TD>{$row['Date_Assigned']}</TD>";
echo "<TD>{$row['ProjectedCompletionDate']}</TD>";
echo "<TD>{$row['Date_Completed']}</TD>";
echo "<TD>{$row['ManhourSpent']}</TD>";
echo "<TD>{$row['Status']}</TD>";
echo "</TR>";
echo"</TBODY>";
}
?>
---------------------------------
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
--- End Message ---
--- Begin Message ---
Is it just me or are you missing a <form action="" method=""></form> tag?
That'd explain the form not posting...
Mike
sam rumaizan skrev:
I'm just a php beginner.
So please be patient with my stupid questions.
What am I missing in this code that causing the function can’t update the textarea?
Update button erase the old information from mysql database and replace it with nothing. Basically it can’t read what is inside the Textarea box. Why??
Read the highlighted code.
<?php
if (isset($_REQUEST['save_assign_engineer'])) {
$id = (int) $_REQUEST['save_assign_engineer'];
$job_title =
mysql_real_escape_string($_REQUEST['Assign_Engineer'][' .$id . ']['Job_Title']);
$sql = "
UPDATE `lo_data`
SET `Job_Title` = '" . $job_title . "'
WHERE `ID` = " . $id;
mysql_query($sql);
}
if (isset($_POST["R"])) {
$result = mysql_query("SELECT * FROM lo_data WHERE Assign_Engineer
='".$_POST["R"]."'");
}
while($row = mysql_fetch_array($result))
{
echo "<TBODY>";
echo "<TR VALIGN=\"TOP\" ALIGN=\"CENTER\">";
echo "<TD>{$row['ID']}</TD>";
echo "<TD>{$row['Ref_No']}</TD>";
echo '<TD> <P><TEXTAREA NAME="Assign_Engineer[' . $row['ID'] . '][Job_Title]"
ROWS="10"
COLS="40">'.$row['Job_Title'] .'</TEXTAREA>';
echo " <BR />";
echo '<button type="submit" name="save_assign_engineer" value="' .
$row['ID'] . '" />Updaet data</button>
';
echo "<TD>{$row['Category']}</TD>";
echo "<TD>{$row['Assign_Engineer']}</TD>";
echo "<TD>{$row['Date_Received']}</TD>";
echo "<TD>{$row['Date_Required']}</TD>";
echo "<TD>{$row['Date_Assigned']}</TD>";
echo "<TD>{$row['ProjectedCompletionDate']}</TD>";
echo "<TD>{$row['Date_Completed']}</TD>";
echo "<TD>{$row['ManhourSpent']}</TD>";
echo "<TD>{$row['Status']}</TD>";
echo "</TR>";
echo"</TBODY>";
}
?>
---------------------------------
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
--- End Message ---