markl999 wrote:Use :
$uerg = mysql_query($uquery) or die(mysql_error());
Also echo $uquery and copy and paste the result into a mysql prompt (or phpMyAdmin etc..) and see if it works 'outside' of your script.
Hi markl999,
1. As you proposed, i added the "$uerg = mysql_query($uquery) or die(mysql_error());" to the script. Result: it doesn't execute anymore! But the mysql log (and the apache log) remain empty:
Code: Select all
bluenote# cd /usr/local/mysql/data
bluenote# tail -10 *err
040125 09:53:54 mysqld started
/export/home/local/mysql-3.23.53-sun-solaris2.7-sparc/bin/mysqld: ready for connections
040126 08:47:32 mysqld started
/export/home/local/mysql-3.23.53-sun-solaris2.7-sparc/bin/mysqld: ready for connections
040127 08:19:29 mysqld started
/export/home/local/mysql-3.23.53-sun-solaris2.7-sparc/bin/mysqld: ready for connections
040129 08:30:16 mysqld started
/export/home/local/mysql-3.23.53-sun-solaris2.7-sparc/bin/mysqld: ready for connections
040130 08:49:31 mysqld started
/export/home/local/mysql-3.23.53-sun-solaris2.7-sparc/bin/mysqld: ready for connections
bluenote# date
Fri Jan 30 12:07:16 MET 2004
bluenote# cd /usr/local/apache/logs
bluenote# tail -10 e*g
їFri Jan 30 08:54:03 2004] їnotice] Apache/1.3.9 (Unix) PHP/4.2.2 configured -- resuming normal operations
So i don't know why...
2. I have changed the table structure a little bit:
id int(11) Nein
s01 enum('01', '02', '03', '04') Nein 01
s02 enum('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z') Nein A
s03 enum('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99') Nein 01
s04 varchar(4) Ja NULL
s05 varchar(255) Nein
s06 varchar(255) Nein
s07 varchar(10) Nein
s08 smallint(5) Nein 0
s09 smallint(5) Nein 0
s10 varchar(100) Nein
s11 varchar(20) Nein
s12 varchar(100) Nein
s13 enum('01', '02') Nein 01
s21 varchar(255) Nein
s22 enum('yes', 'no') Nein no
s23 varchar(255) Nein
s25 text Nein
s26 text Nein
s32 date Nein 0000-00-00
s33 varchar(40) Nein
s34 text Nein
s35 char(2) Nein
s39 enum('yes', 'no') Nein no
s40 text Nein
s43 enum('yes', 'no') Nein no
s45 text Nein
s49 enum('yes', 'no') Nein no
s50 varchar(255) Nein
s51 enum('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31') Nein 00
s52 enum('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') Nein 00
s53 year(4) Nein 0000
s54 enum('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31') Nein 00
s55 enum('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') Nein 00
s56 year(4) Nein 0000
s58 date Nein 0000-00-00
s59 date Nein 0000-00-00
s60 enum('in progress', 'done') Nein in progress
s61 varchar(50) Nein
s62 varchar(50) Nein
s63 varchar(50) Nein
s64 varchar(4) Nein
Indizes : Name Typ Kardinalität Feld
PRIMARY PRIMARY 501 id
and reorganised the script afterwards.
3. After removing the add-on, the echo output of switch($login) is (for i belong to usergroup 01):
Code: Select all
<?php
UPDATE staff SET staff.s01 = '03', staff.s02 = 'K', staff.s03 = '02', staff.s05 = 'Kaiser', staff.s06 = 'Wulf', staff.s07 = 'W.', staff.s08 = 491, staff.s09 = 42, staff.s10 = 'test', staff.s11 = '', staff.s12 = 'IT Support / Database Administration', staff.s13 = '02', staff.s21 = 'test@test.de', staff.s22 = 'no', staff.s23 = '', staff.s25 = '', staff.s26 = '', staff.s32 = 2004-01-30, staff.s33 = '192.168.0.101', staff.s35 = '01', staff.s39 = 'no', staff.s49 = 'no', staff.s50 = 'Boss', staff.s51 = '00', staff.s52 = '00', staff.s53 = 0000, staff.s54 = '00', staff.s55 = '00', staff.s56 = 0000, staff.s58 = 0000-00-00, staff.s59 = 0000-00-00, staff.s60 = 'done', staff.s64 = 'zp' WHERE staff.s04 = '0535' AND staff.id = '1100'
?>
I tried the code in the mysql command line (on every machine) in in phpmyadmin (2.5.4) - it worked! But when executed from within the script, NOTHING happens - no errors, no update.
-bluenote