NYCPHP Meetup

NYPHP.org

[nycphp-talk] php + mysql

John Lacey jlacey at att.net
Sat Dec 18 14:53:52 EST 2004


Juancarlos Aponte wrote:
> This is what I have right now as a test script.
> 
> # test.php
> <?php
> 
> echo 'Hello World';
> 
> require_once ('mysql/mysql_connect.php');
> 
> $query = "INSERT into espana_pics (pid, filepath, filename, title)
> VALUES (1, images/, eiffel.jpg, Eiffel)";
> $result = @mysql_query ($query);
> ?>
> 
> # mysql_connect.php
> <?php
> 
> define('DB_USER','root');
> define('DB_PASSWORD','password');
> define('DB_HOST','localhost');
> define('DB_NAME','serverdb');
> 
> $dbc = mysql_connect (DB_HOST,DB_USER,DB_PASSWORD);
> mysql_select_db (DB_NAME);
> 
> ?>
> 
> To my knowledge that is correct syntax.

have you tried a "mysqli_connect"?


> 
> The other problem that I have is that index.php doesn't work.  I can't
> just type in /phpmyadmin and it goes to index.php, I have to
> physically put in index.php in the address bar. It's annoying and I
> dont know where to fix it.


the "DirectoryIndex" directive handles that...  for apache 2.x they 
broke out sections of the httpd.conf file into "ssl.conf", "php.conf", 
etc.  if you have a php.conf file look there, if not, check that 
directive in httpd.conf

If I recall, this concerned a windows 2003 platform -- I only use a 
windows platform with XAMPP (runs apache 2.x) for convenience, my 
hosting company runs apache 1.3.33.  So, double-check the above .conf 
files locations on the windows box you're on.









More information about the talk mailing list