[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-windows
Subject:    Re: [PHP-WIN] unhappy camper
From:       "Patrick" <patrickolson () qwest ! net>
Date:       2001-03-31 9:16:27
[Download RAW message or body]

<?php
$link_id = mysql_connect ("localhost", "YOU", "PASSWORD")
 or die ("Could not connect");
    print ("Connected successfully<br>");

$result = mysql_list_tables ("MYSQL")
 or die ("Invalid query<br>");
 print ("Connected successfully<br>");
while ($i < mysql_num_rows ($result)) {
    $tb_names[$i] = mysql_tablename ($result, $i);
    echo $tb_names[$i] . "<BR>";
    $i++;
}
?>
this is from the php manual


""paul morgan"" <paul@sibley-morgan.freeserve.co.uk> wrote in message
news:9a3623$72d$1@toye.p.sourceforge.net...
> hi,
> I'm new to this game but have managed to set up apache 1.3.19 that runs
> php/4.0.4pl1 (the apache dll I think) on Win 98 SE. I've also installed
the
> windows build of mysql, version 3.23 I think and can administer easily via
> the msdos prompt. I have removed the general root user, as in the mysql
Docs
> and replaced it with my own logon user and pwd.
>
> The problem is that I can't seem to pull anything out of a database that I
> create. I've read the docs that come with mysql, esp Ch6 and privileges,
but
> even simple things like typing 'show grants;' gives me an error in the
msdos
> prompt yet I can insert, delete etc  data from the database I created
whilst
> in the msdos prompt - command line interface. I can connect to mysql using
> the 'mysql_connect() function in php I think (I don't get any erroes when
> just testing the connection) but when actually going to do something via
php
> I get an error similar to this;
>
> Warning: Supplied argument is not a valid MySQL result resource in
> ...location of file then line number.
>
> Some example code that fails is below. It fails on the line where the
> 'while' loop starts but I think that's because the $result var doesn't
seem
> to be allowed to list tables?? but I don't know why.
>
>
> <?php
>
> $link_id = mysql_connect("localhost", "myUsername", "myPassword");
>
> $result = mysql_query("SHOW TABLES", $link_id);
>
> while($query_data = mysql_fetch_row($result))
> {
>  echo "$query_data[0], is some data <br>";
> }
>
> ?>
>
>
> Anyone got any ideas as to why I'm getting stuffed? Is it permissions
within
> mysql or is there a known bug in one of the apps that is messing me about.
> Any suggestions gratefully received. Please reply to this or to my addy
> directly.
>
> Many thanks  ;)
>
> Paul
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic