RE: [PHP-DB] Dropdown list question...
Thanks for the answers. This has resolved my problem. -Original Message- From: Andrey Hristov [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 11:21 AM To: NIPP, SCOTT V (SBCSI) Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Dropdown list question... - Original Message - From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 29, 2002 7:12 PM Subject: [PHP-DB] Dropdown list question... > I am populating a dropdown list from a database. This is working > fine with one minor glitch... For some reason, the first entry in the > database does not seem to be getting populated into the list. I do not see > anything wrong, and was hoping that someone else might be able to spot a > problem. Here is the code that generates the dropdown list: > > $query_systems = "SELECT Name FROM systems"; > $systems = mysql_query($query_systems, $Test) or die(mysql_error()); > $row_systems = mysql_fetch_assoc($systems); Here is your error. You do fetch_assoc and then you are not using it. Comment it out. > $totalRows_systems = mysql_num_rows($systems); > $sys_list = "\n"; > $sys_list .= "System Name\n"; > $sys_list .= "---\n"; > while($name = mysql_fetch_row($systems)) { > $sys_list .= "$name[0]\n"; > } > $sys_list .= "\n"; > > Thanks in advance for the help. > > Scott Nipp > Phone: (214) 858-1289 > E-mail: [EMAIL PROTECTED] > Web: http:\\ldsa.sbcld.sbc.com > Regards, Andrey Hristov -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Dropdown list question...
> I am populating a dropdown list from a database. This is working >fine with one minor glitch... For some reason, the first entry in the >database does not seem to be getting populated into the list. I do not see >anything wrong, and was hoping that someone else might be able to spot a >problem. Here is the code that generates the dropdown list: > >$query_systems = "SELECT Name FROM systems"; >$systems = mysql_query($query_systems, $Test) or die(mysql_error()); >$row_systems = mysql_fetch_assoc($systems); >$totalRows_systems = mysql_num_rows($systems); >$sys_list = "\n"; >$sys_list .= "System Name\n"; >$sys_list .= "---\n"; >while($name = mysql_fetch_row($systems)) { > $sys_list .= "$name[0]\n"; >} >$sys_list .= "\n"; mysql_fetch_assoc (http://www.php.net/manual/en/function.mysql-fetch-assoc.php) and mysql_fetch_row (http://www.php.net/manual/en/function.mysql-fetch-row.php) both return a row. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Dropdown list question...
- Original Message - From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 29, 2002 7:12 PM Subject: [PHP-DB] Dropdown list question... > I am populating a dropdown list from a database. This is working > fine with one minor glitch... For some reason, the first entry in the > database does not seem to be getting populated into the list. I do not see > anything wrong, and was hoping that someone else might be able to spot a > problem. Here is the code that generates the dropdown list: > > $query_systems = "SELECT Name FROM systems"; > $systems = mysql_query($query_systems, $Test) or die(mysql_error()); > $row_systems = mysql_fetch_assoc($systems); Here is your error. You do fetch_assoc and then you are not using it. Comment it out. > $totalRows_systems = mysql_num_rows($systems); > $sys_list = "\n"; > $sys_list .= "System Name\n"; > $sys_list .= "---\n"; > while($name = mysql_fetch_row($systems)) { > $sys_list .= "$name[0]\n"; > } > $sys_list .= "\n"; > > Thanks in advance for the help. > > Scott Nipp > Phone: (214) 858-1289 > E-mail: [EMAIL PROTECTED] > Web: http:\\ldsa.sbcld.sbc.com > Regards, Andrey Hristov -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Dropdown list question...
I am populating a dropdown list from a database. This is working fine with one minor glitch... For some reason, the first entry in the database does not seem to be getting populated into the list. I do not see anything wrong, and was hoping that someone else might be able to spot a problem. Here is the code that generates the dropdown list: $query_systems = "SELECT Name FROM systems"; $systems = mysql_query($query_systems, $Test) or die(mysql_error()); $row_systems = mysql_fetch_assoc($systems); $totalRows_systems = mysql_num_rows($systems); $sys_list = "\n"; $sys_list .= "System Name\n"; $sys_list .= "---\n"; while($name = mysql_fetch_row($systems)) { $sys_list .= "$name[0]\n"; } $sys_list .= "\n"; Thanks in advance for the help. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php