[PHP-DEV] Bug #12895 Updated: mysql_fetch_row

2001-08-29 Thread lampa

ID: 12895
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: MySQL related
Operating System: Debian 2.2
PHP Version: 4.0.6
New Comment:

ohh sorry, should be mysql_fetch_array, sorry for mistake

Previous Comments:


[2001-08-28 04:40:10] [EMAIL PROTECTED]

mysql_fetch_row does NOT return an associative array. Use mysql_fetch_array or 
mysql_fetch_assoc instead.



[2001-08-22 09:49:07] [EMAIL PROTECTED]

when i call mysql_fetch_row($result, MYSQL_BOTH) a should got associte array, but 
don't.

if there are some fields with NULL only number is shown not name of field
-
Example:

fields in db: id, t1, n1
value 0, 'text', NULL

after mysql_fetch_row($result, MYSQL_BOTH), print_r returns:
Array([0] = 5 [id] = 5 [1] = 'text' [t1] = 'text' [2] = 2)

there is missing n1 = 2





Edit this bug report at http://bugs.php.net/?id=12895edit=1


-- 
PHP Development 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-DEV] Bug #12895 Updated: mysql_fetch_row

2001-08-29 Thread cynic

ID: 12895
Updated by: cynic
Reported By: [EMAIL PROTECTED]
Old Status: Bogus
Status: Open
Old Bug Type: MySQL related
Bug Type: Feature/Change Request
Operating System: Debian 2.2
PHP Version: 4.0.6
New Comment:

assuming you meant you missed nl = null, and the dump should've ended with [2] = 
null instead of [2] = 2, this is a 'feature', and you're not the only one questioning 
this behavior. changing to change request. I hope Zeev notices this, and finally 
allows this change in. :)

Previous Comments:


[2001-08-29 07:48:10] [EMAIL PROTECTED]

ohh sorry, should be mysql_fetch_array, sorry for mistake



[2001-08-28 04:40:10] [EMAIL PROTECTED]

mysql_fetch_row does NOT return an associative array. Use mysql_fetch_array or 
mysql_fetch_assoc instead.



[2001-08-22 09:49:07] [EMAIL PROTECTED]

when i call mysql_fetch_row($result, MYSQL_BOTH) a should got associte array, but 
don't.

if there are some fields with NULL only number is shown not name of field
-
Example:

fields in db: id, t1, n1
value 0, 'text', NULL

after mysql_fetch_row($result, MYSQL_BOTH), print_r returns:
Array([0] = 5 [id] = 5 [1] = 'text' [t1] = 'text' [2] = 2)

there is missing n1 = 2





Edit this bug report at http://bugs.php.net/?id=12895edit=1


-- 
PHP Development 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-DEV] Bug #12895 Updated: mysql_fetch_row

2001-08-29 Thread lampa

ID: 12895
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Feature/Change Request
Operating System: Debian 2.2
PHP Version: 4.0.6
New Comment:

for avoid a misunderstanding here is example, which shows this bug:

!doctype html public -//w3c//dtd html 4.0 transitional//en
html
head
titlemysql_fetch_array/title
meta name=generator content=Handmade by Lampa
/head
body
?
  if (!($linkid = @mysql_connect(localhost))) {
echo Connecting failedbr;
exit();
  } else {
echo Connecting to db okbr;
  }

  @mysql_select_db(test);
  mysql_query(DROP TABLE test_lampa, $linkid);

  if (!(@mysql_query(CREATE TABLE test_lampa (id INT NOT NULL AUTO_INCREMENT PRIMARY 
KEY, txt VARCHAR(100), nr INT NULL), $linkid))) {
echo Create failedbr;
exit();
  } else {
echo CREATE ok...br;
  }
  if (!(@mysql_query(INSERT INTO test_lampa VALUES(NULL, 'text', NULL), $linkid))) {
echo INSERT failedbr;
exit();
  } else {
echo INSERT ok...br;
  }
  if (!($result = @mysql_query(SELECT * FROM test_lampa, $linkid))) {
echo SELECT failedbr;
exit();
  } else {
echo SELECT ok...br;
  }

  $line = mysql_fetch_array($result, MYSQL_BOTH);

  print_r($line);

  echo hrYou should see 6 values, 'coz there are 3 fields in db,but you see only 5 
---bBUG/bbrbr;

  if (!(@mysql_query(INSERT INTO test_lampa VALUES(NULL, 'text', 1), $linkid))) {
echo INSERT failedbr;
exit();
  } else {
echo INSERT ok...br;
  }
  if (!($result = @mysql_query(SELECT * FROM test_lampa, $linkid))) {
echo SELECT failedbr;
exit();
  } else {
echo SELECT ok...br;
  }

  $line = mysql_fetch_array($result, MYSQL_BOTH);
  $line = mysql_fetch_array($result, MYSQL_BOTH);   // get 2nd value

  print_r($line);

  echo hrHere are really 6 values.;

  mysql_close($linkid);
?
/body
/html


Previous Comments:


[2001-08-29 11:15:51] [EMAIL PROTECTED]

assuming you meant you missed nl = null, and the dump should've ended with [2] = 
null instead of [2] = 2, this is a 'feature', and you're not the only one questioning 
this behavior. changing to change request. I hope Zeev notices this, and finally 
allows this change in. :)



[2001-08-29 07:48:10] [EMAIL PROTECTED]

ohh sorry, should be mysql_fetch_array, sorry for mistake



[2001-08-28 04:40:10] [EMAIL PROTECTED]

mysql_fetch_row does NOT return an associative array. Use mysql_fetch_array or 
mysql_fetch_assoc instead.



[2001-08-22 09:49:07] [EMAIL PROTECTED]

when i call mysql_fetch_row($result, MYSQL_BOTH) a should got associte array, but 
don't.

if there are some fields with NULL only number is shown not name of field
-
Example:

fields in db: id, t1, n1
value 0, 'text', NULL

after mysql_fetch_row($result, MYSQL_BOTH), print_r returns:
Array([0] = 5 [id] = 5 [1] = 'text' [t1] = 'text' [2] = 2)

there is missing n1 = 2





Edit this bug report at http://bugs.php.net/?id=12895edit=1


-- 
PHP Development 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-DEV] Bug #12895 Updated: mysql_fetch_row

2001-08-28 Thread sander

ID: 12895
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: MySQL related
Operating System: Debian 2.2
PHP Version: 4.0.6
New Comment:

mysql_fetch_row does NOT return an associative array. Use mysql_fetch_array or 
mysql_fetch_assoc instead.

Previous Comments:


[2001-08-22 09:49:07] [EMAIL PROTECTED]

when i call mysql_fetch_row($result, MYSQL_BOTH) a should got associte array, but 
don't.

if there are some fields with NULL only number is shown not name of field
-
Example:

fields in db: id, t1, n1
value 0, 'text', NULL

after mysql_fetch_row($result, MYSQL_BOTH), print_r returns:
Array([0] = 5 [id] = 5 [1] = 'text' [t1] = 'text' [2] = 2)

there is missing n1 = 2





Edit this bug report at http://bugs.php.net/?id=12895edit=1


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