RE: [PHP-DB] Re: mysql_fetch_array() doesn't work
>-Original Message- >From: Web user [mailto:[EMAIL PROTECTED]] >Sent: 30 September 2001 22:15 >To: [EMAIL PROTECTED] >Subject: [PHP-DB] Re: mysql_fetch_array() doesn't work [snip] >It only works when the $arr['user_id'] is out of the quotes. >echo "target='_top'>"; >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 No need for quotes anyway: $arr[key] works just fine :) regards -- Jason Wong Gremlins Associates www.gremlins.com.hk Tel: +852-2573-5033 Fax: +852-2573-5851 -- 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-DB] Re: mysql_fetch_array() doesn't work
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 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] Re: mysql_fetch_array() doesn't work
My opinion is that there is a problem with the $query. May be the problem is like this select fname from some_table where lname=Smith; this is not good sql. I missed the quotes around Smith. or you make varaible substitution in the query string. Debug the code, instead of mysql_query($query); do var_dump($query) and see what you send to mysql. you may also use mysql_error(hmm no sure about the name). Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 25, 2001 4:17 PM Subject: RE: [PHP-DB] Re: mysql_fetch_array() doesn't work > I agree with Steve. > > Also, print value of $num; is it 0? Is $res valid; is it NULL? > > We need far more details than what you think we need. > > -Original Message- > From: Steve Brett [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 25, 2001 6:34 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Re: mysql_fetch_array() doesn't work > > > there doesn't look to be any problem with the code you've shown. > > it would be helpful, however, if you included the full error including the > line and the lines surrounding this point as the error probably lies in > previous code. > > Steve > > "Web User" <[EMAIL PROTECTED]> wrote in message > 008501c1459e$5dd87260$6a915fd3@hexiao">news:008501c1459e$5dd87260$6a915fd3@hexiao... > > System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98 > > > > > .. > > .. > > $res=mysql_query($query); > > $num=mysql_num_rows($res); > > for($i=0; $i<$num; $i++){ > > $arr=mysql_fetch_array($res); > > ... > > } > > ... > > > > > > 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\...\page.php on line ..." > > > > What's the problem wiht mysql_fetch_array() or other? > > > > Thanks! > > Mike > > > > > > > > > > > > -- > 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] Re: mysql_fetch_array() doesn't work
I agree with Steve. Also, print value of $num; is it 0? Is $res valid; is it NULL? We need far more details than what you think we need. -Original Message- From: Steve Brett [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 25, 2001 6:34 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: mysql_fetch_array() doesn't work there doesn't look to be any problem with the code you've shown. it would be helpful, however, if you included the full error including the line and the lines surrounding this point as the error probably lies in previous code. Steve "Web User" <[EMAIL PROTECTED]> wrote in message 008501c1459e$5dd87260$6a915fd3@hexiao">news:008501c1459e$5dd87260$6a915fd3@hexiao... > System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98 > > .. > .. > $res=mysql_query($query); > $num=mysql_num_rows($res); > for($i=0; $i<$num; $i++){ > $arr=mysql_fetch_array($res); > ... > } > ... > > > 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\...\page.php on line ..." > > What's the problem wiht mysql_fetch_array() or other? > > Thanks! > Mike > > > > -- 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-DB] Re: mysql_fetch_array() doesn't work
there doesn't look to be any problem with the code you've shown. it would be helpful, however, if you included the full error including the line and the lines surrounding this point as the error probably lies in previous code. Steve "Web User" <[EMAIL PROTECTED]> wrote in message 008501c1459e$5dd87260$6a915fd3@hexiao">news:008501c1459e$5dd87260$6a915fd3@hexiao... > System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98 > > .. > .. > $res=mysql_query($query); > $num=mysql_num_rows($res); > for($i=0; $i<$num; $i++){ > $arr=mysql_fetch_array($res); > ... > } > ... > > > 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\...\page.php on line ..." > > What's the problem wiht mysql_fetch_array() or other? > > Thanks! > Mike > > > > -- 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]