RE: Notice: Undefined index:

2003-01-15 Thread Maureen Roihl

That looks like a PHP problem to me. Have you tried mysql_fetch_assoc()? I
believe mysql_fetch_row() gets you an array with a numeric index (in which
case lastname would be in $line[0]). 

 Notice: Undefined index: lastname in E:\IIS Webs\index.php on line 29
 
 ?
 
 PRINT HTML;
 PRINT HEAD;
 PRINT TITLEADDRESSES/title;
 
 PRINT /HEAD;
 
 PRINT BODY BGCOLOR=white TEXT=#00 LINK=#FF VLINK=#66
 aLINK=#FF;
 
 mysql_pconnect(127.0.0.1:3308, user, pass) or
 die(could not connect);
 mysql_select_db(address);
 
 $query = SELECT lastname, firstname, city FROM data;
 $result = mysql_query ($query);
 
 while ($line = mysql_fetch_row($result)) {
 
 echo BR.$line['lastname'];
 echo BR.$line['firstname'];
 echo BR.$line['city'].BR;
 
 }
 
 ?
 
 
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Notice: Undefined index:

2003-01-15 Thread dunk fordyce
dont forget mysql_fetch_object()

then you will have $line-lastname;

Maureen Roihl wrote:

That looks like a PHP problem to me. Have you tried mysql_fetch_assoc()? I
believe mysql_fetch_row() gets you an array with a numeric index (in which
case lastname would be in $line[0]). 


Notice: Undefined index: lastname in E:\IIS Webs\index.php on line 29

?

PRINT HTML;
PRINT HEAD;
PRINT TITLEADDRESSES/title;

PRINT /HEAD;

PRINT BODY BGCOLOR=white TEXT=#00 LINK=#FF VLINK=#66
aLINK=#FF;

   mysql_pconnect(127.0.0.1:3308, user, pass) or
   die(could not connect);
   mysql_select_db(address);

   $query = SELECT lastname, firstname, city FROM data;
   $result = mysql_query ($query);

   while ($line = mysql_fetch_row($result)) {

   echo BR.$line['lastname'];
   echo BR.$line['firstname'];
   echo BR.$line['city'].BR;

}

?





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





--

---
===
--- :::   :::  :::   :::   :::===   :::===
--- :::  ===  :::  ::   ===  ::   ===  ===  ::: === ===
--- ===  ===  ===   =   === === ===
--- ===  ===  ===   ===   ===  ===  === ===
--- ===   ===      ==   === ===
www.dunkfordyce.co.uk==



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Notice: Undefined index:

2003-01-15 Thread Victor Pendleton
It that does not work. You could try the following snippet:

if ($result = mysql_query ($query);)
{
while ($row = mysql_fetch_array ($result))
{
...
}

mysql_free_result($result);
}
else
{
...
}

-Original Message-
From: Maureen Roihl [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 7:49 AM
To: 'C. Reeve'; MySQL List
Subject: RE: Notice: Undefined index:



That looks like a PHP problem to me. Have you tried mysql_fetch_assoc()? I
believe mysql_fetch_row() gets you an array with a numeric index (in which
case lastname would be in $line[0]). 

 Notice: Undefined index: lastname in E:\IIS Webs\index.php on line 29
 
 ?
 
 PRINT HTML;
 PRINT HEAD;
 PRINT TITLEADDRESSES/title;
 
 PRINT /HEAD;
 
 PRINT BODY BGCOLOR=white TEXT=#00 LINK=#FF VLINK=#66
 aLINK=#FF;
 
 mysql_pconnect(127.0.0.1:3308, user, pass) or
 die(could not connect);
 mysql_select_db(address);
 
 $query = SELECT lastname, firstname, city FROM data;
 $result = mysql_query ($query);
 
 while ($line = mysql_fetch_row($result)) {
 
 echo BR.$line['lastname'];
 echo BR.$line['firstname'];
 echo BR.$line['city'].BR;
 
 }
 
 ?
 
 
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Notice: Undefined index:

2003-01-15 Thread Maureen Roihl

mysql_fetch_array() does the same thing as mysql_fetch_assoc(), both will
return the record as an associative array, which is how you're trying to
access it.

 -Original Message-
 From: Victor Pendleton [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 15, 2003 9:49 AM
 To: 'Maureen Roihl'; 'C. Reeve'; MySQL List
 Subject: RE: Notice: Undefined index:
 
 
 It that does not work. You could try the following snippet:
 
   if ($result = mysql_query ($query);)
   {
   while ($row = mysql_fetch_array ($result))
   {
   ...
   }
 
   mysql_free_result($result);
   }
   else
   {
   ...
   }
 
 -Original Message-
 From: Maureen Roihl [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 15, 2003 7:49 AM
 To: 'C. Reeve'; MySQL List
 Subject: RE: Notice: Undefined index:
 
 
 
 That looks like a PHP problem to me. Have you tried 
 mysql_fetch_assoc()? I
 believe mysql_fetch_row() gets you an array with a numeric 
 index (in which
 case lastname would be in $line[0]). 
 
  Notice: Undefined index: lastname in E:\IIS Webs\index.php 
 on line 29
  
  ?
  
  PRINT HTML;
  PRINT HEAD;
  PRINT TITLEADDRESSES/title;
  
  PRINT /HEAD;
  
  PRINT BODY BGCOLOR=white TEXT=#00 LINK=#FF VLINK=#66
  aLINK=#FF;
  
  mysql_pconnect(127.0.0.1:3308, user, pass) or
  die(could not connect);
  mysql_select_db(address);
  
  $query = SELECT lastname, firstname, city FROM data;
  $result = mysql_query ($query);
  
  while ($line = mysql_fetch_row($result)) {
  
  echo BR.$line['lastname'];
  echo BR.$line['firstname'];
  echo BR.$line['city'].BR;
  
  }
  
  ?
  
  
  
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Notice: Undefined index:

2003-01-14 Thread C. Reeve
Hi,

Anyone know why I would be receiving this error in Windows. I have a small
PHP script that accesses a MySQL database and prints out a couple lines.
This works fine in LinuxI have searched google and found many users with
the same problem, but not one solution.

TIA

Notice: Undefined index: lastname in E:\IIS Webs\index.php on line 29

?

PRINT HTML;
PRINT HEAD;
PRINT TITLEADDRESSES/title;

PRINT /HEAD;

PRINT BODY BGCOLOR=white TEXT=#00 LINK=#FF VLINK=#66
aLINK=#FF;

mysql_pconnect(127.0.0.1:3308, user, pass) or
die(could not connect);
mysql_select_db(address);

$query = SELECT lastname, firstname, city FROM data;
$result = mysql_query ($query);

while ($line = mysql_fetch_row($result)) {

echo BR.$line['lastname'];
echo BR.$line['firstname'];
echo BR.$line['city'].BR;

}

?



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php