Re: HELP!!!
| From: | Ken N | Date: | Wed, 05 Jul 2000 19:24:23 +0000 |
| Subject: | Re: HELP!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5098@lists.php.net to get a copy of this message | ||
That means the something returned a null value - from the looks of it you
might want to try $mysql_link = mysql_connect($dbhost, $dbuser,
$dbpasswd);
Then you might want ot say mysql_select_db(dbname);
check out http://www.php.net/manual/function.mysql-connect.php
for some
example code.
Ken
http://cleveland.lug.net/~rocket/
The answer is simple if you grant that ironies are like submarines;
dangerous only when submerged.
On Wed, 5 Jul 2000, Joel Johnston wrote:
> I'm a newbie!! now that thats outta the way, I need help. I'm trying to
> do a simple query to my MySQL datasource. Whenever I do a query and try
> to report anything from the results I get the following error.
>
>
> Warning: 0 is not a MySQL result index in
> /usr/local/etc/httpd/htdocs/sanddollarauto.com/php3/testconnect.php3 on
> line 23
>
> It doesn't matter what the query contains or how it is output. I get
> this error no matter what I do. I'm a Cold Fusion Developer and am new
> to PHP but shouldn't the following code work?
>
>
> <?php
>
> $dbuser = 'root';
>
> $dbhost = 'localhost';
>
> $dbpass = 'password';
>
> $dbname = 'sand';
>
> $dbtble = 'new_cars';
>
> $mysql_link = mysql_connect();
>
> $column =
> mysql_list_fields($dbname,$dbtble,$mysql_link);
>
>
> {
> print mysql_field_name($column,1)."<br>";
> }
>
> ?>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>