[PHP-WIN] mysql_fetch_array() doesn't work

2001-09-25 Thread Web user

System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98


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-WIN] mysql_fetch_array() doesn't work

2001-09-26 Thread Web user

System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]"

What's the problem wiht mysql_fetch_array() or other?
What does the T_STRING' or `T_VARIABLE' or `T_NUM_STRING' mean?

THANKS
Mike


The full code below:

-

User
Added timeStatus";
$num=mysql_num_rows($res);
for($i=0; $i<$num; $i++) {
$arr=mysql_fetch_array($res);   /* HERE is line where the error occurs!!!
*/
echo "
$arr['user_name']>";
echo "$arr['time']";
echo "$arr['status']";
echo "$arr['comment']";
}

echo "";

echo "";  /* show others in multi-pages */
for($i=0; $i<$pages; $i++){
echo "
echo ($i+1)."";
echo "  ";
}
echo "";

?>


-
create table users (
user_id int not null auto_increment primary key,
user_name varchar(30),
time datetime,
status tinyint(1),
comment text,
sign tinyint(1) default '1'
);






-- 
PHP Windows 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-WIN] Re: mysql_fetch_array() doesn't work

2001-09-30 Thread Web user

Hello,
First, Thank you all for your help!
I  finally found the reason for why does  the IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]"

It is because the echo (including print) doesn't work at the line below,
echo "";
showing the error info as I mentioned. ( but it should work according to PHP
books)

It only works when  the $arr['user_id'] is out of the quotes.
echo "";
then IE showed no error any longer.

So I have to let all $arr['key']  out of the quotes, then the scripts are
Ok.

Regards
Mike










-- 
PHP Windows 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-WIN] session open failed and header() don't redirect

2001-10-09 Thread Web user

Hi,
There are problems with session and header();
Please give me some advice.
Thank you!
Mike


System: PHP4.06 + Apache 1.3.20 Win32 + Win98 (the session configurations
are default in php.ini)
when the 1.php is running, the IE shows 2 errors  as below:

Warning: open(/tmp\sess_5176646ce5a800db9101970b80d507f6, O_RDWR) failed: m
(2) in c:\program files\apache group\apache\htdocs\web1\1.php on line 2

Warning: Cannot add header information - headers already sent by (output
started at c:\program files\apache group\apache\htdocs\web1\1.php:2) in
c:\program files\apache group\apache\htdocs\web1\1.php on line 6

---
The scripts of 1.php: (1.php and 2.php are under the same base directory)

---
The scripts of html-head.inc:



page title



 -
 The scripts of html-foot.inc:














-- 
PHP Windows 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-WIN] session open failed

2001-10-11 Thread Web user

Hi,
There are problems with session, Please give me some advice.
Thank you!
Mike


System: PHP4.06 + Apache 1.3.20 Win32 + Win98 (the session configurations
are default in php.ini)
when the 1.php is running, the IE shows 2 errors  as below:

Warning: open(/tmp\sess_5176646ce5a800db9101970b80d507f6, O_RDWR) failed: m
(2) in c:\program files\apache group\apache\htdocs\web1\1.php on line 2

Warning: Cannot add header information - headers already sent by (output
started at c:\program files\apache group\apache\htdocs\web1\1.php:2) in
c:\program files\apache group\apache\htdocs\web1\1.php on line 6

---
The scripts of 1.php: (1.php and 2.php are under the same base directory)

---
The scripts of html-head.inc:



page title



 -
 The scripts of html-foot.inc:








-- 
PHP Windows 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]