NYCPHP Meetup

NYPHP.org

[nycphp-talk] php + mysql

Juancarlos Aponte j.aponte at gmail.com
Sat Dec 18 14:37:26 EST 2004


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.

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.

On Sat, 18 Dec 2004 12:24:28 -0700, John Lacey <jlacey at att.net> wrote:
> Juancarlos Aponte wrote:
> > phpmyadmin 2.6.1, downloaded two days ago.
> >
> 
> ok, had to ask since I didn't see that mentioned in the thread...
> 
> pardon me for asking an obvious question here, but is it safe to assume
> that in addition to phpmyadmin not working that a connection cannot be
> made to mysql with a short test script?
> 
> John
> 
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
> 


-- 
.: Juancarlos :.

"Any fool can know. The point is to understand."
-Albert Einstein



More information about the talk mailing list