Re: Help getting Info from Table
| From: | Jason Wong | Date: | Thu, 08 Nov 2001 14:42:50 +0000 |
| Subject: | Re: Help getting Info from Table | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14141@lists.php.net to get a copy of this message | ||
On Thursday 08 November 2001 21:54, Michael Elliott wrote:
[snip]
> Anyway, here is what I though would work and it doesn't. Any
> suggestions? Thanks.
> Name:
>
> Parent: Warning: Supplied argument is not a valid MySQL-Link
> resource in c:\program
> files\nusphere\apache\nsdocs\golfparfection\admin\newdepartment.php
> on line 31 Warning: Supplied argument is not a valid MySQL result
> resource in c:\program
> files\nusphere\apache\nsdocs\golfparfection\admin\newdepartment.php
> on line 33 <?php
> mysql_pconnect $DB_SERVER,$DB_LOGIN, $DB_PASSWORD);
Change to:
$link = mysql_pconnect $DB_SERVER,$DB_LOGIN, $DB_PASSWORD);
> $query = "Select Name from $DB.Departments";
> $result = mysql_query($query, $link);
>
> for ($i = 0; $i < mysql_num_rows($result); $i++)
> echo("<OPTION>" . mysql_tablename($result, $i));
>
> ?>
>
> Results in: (Nothing comes up in the Parent field)
hth
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk