Hi,
I had a similar problem which I "solved" by putting
...
$db = mysql_connect($hostname, $username, $password);
mysql_select_db($dbname, $db);
in a .inc file which is required for each php file.
I don't know if this is good way, but it works for me. Note that I am a newbie
in the whole RDBMS/MySQL/PHP world.
Petri
MKempton@stripped wrote:
> I have installed mysql and php (Apache module). Written some php pages with
> great success, however I can't get the Tutorial examples to work (webmonkey
> php/mysql
> http://www.hotwired.com/webmonkey/databases/tutorials/tutorial4.html)
>
> The php part works and I connect to the database, but my query doesn't
> work??? msg. reads...
>
> Warning: 0 is not a MySQL link index in
> /usr/local/apache/htdocs/beeftest/php3/test2.php3 on line 19
> I have localhost root "password" defined in mysql and also beef.org root
> "no password and beef.org www "no password???
>
> Michael E. Kempton
> Consultant WebMaster
> 303.850.3388
> mkempton@stripped
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread15316@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.