I don"t know what I"m doing wrong

I don"t know what I"m doing wrong

am 11.09.2008 23:45:49 von Daniel Wagner

--0-380872989-1221169549=:27263
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

I am currently going through 'davidj's php tutorials @
http://www.dreamweaverclub.com/vtm/php-mysql-apache.php and am in the proce=
ss of learning.=A0 I am encountering an issue though that I can't seem to f=
ind an answer to.=A0 Maybe someone can help me. 
I downloaded the WAMP server, (which I found out I could do after painstaki=
ngly manually setting up my own set of wamp programs) and made it up to the=
part of the tutorials when I am required to check out my work.=20
(This is my connections.php)

//////////////////////////////////////
$database  =A0 = =A0 "practice";
$username  =A0 = =A0 "daniel";
$password  =A0 = =A0 "buggytaz";
///////////////////////////////////////
$link      =A0 = =A0 @mysql_connect('localhost', $username,=
$password);
$db        =A0 = =A0 mysql_select_db($database, $link);
?>

(And this is my practice.php)

require_once("Connections/connection.php");=A0 //database connection

/////////////////////////////////////////////////////
$query   =3Dsprintf("SELECT * FROM table1");
$result=A0 =3D@mysql_query($query);
$row     =3Dmysql_fetch_array($result);
/////////////////////////////////////////////////////
echo $row['field2'];
?>

The database IS in place through the SQL managment program.
I am able to view my php.info document.
Now... this is the issue that I am having.
When I try to view the page I get this back:

Warning: require_once(Connections/connection.php) [function.require-once]: =
failed to open stream: No such file or directory in C:\wamp\www\WebRoot\Tes=
t\Images\practice.php on line 2
Fatal error: require_once() [function.require]: Failed opening required 'Co=
nnections/connection.php' (include_path=3D'.;C:\php5\pear') in C:\wamp\www\=
WebRoot\Test\Images\practice.php on line 2

I have a feeling that my issue is contained within:   (include_path=3D'=
..;C:\php5\pear')
But I honestly have no idea.
Please give me a hand if you can.
Unable2peastr8@yahoo.com =0A
--0-380872989-1221169549=:27263--

Re: I don"t know what I"m doing wrong

am 12.09.2008 04:48:37 von John Harris

On 11 Sep 2008 14:45, Daniel Wagner wrote

> (This is my connections.php)
>
> [snip]
> $db        =A0 = =A0 mysql_select_db($database, $lin=
k);
> ?>
>
> (And this is my practice.php)
>
> > require_once("Connections/connection.php");=A0 //database connection
>
[snip]
> When I try to view the page I get this back:
>
> Warning: require_once(Connections/connection.php) [function.require-once=
]:
> failed to open stream: No such file

I can't see a problem if your connection.php file is located off the
practice.php folder.

C:\wamp\www\WebRoot\Test\Images\Connections\connection.php

In which folder is the connection.php file located?

-John


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: I don"t know what I"m doing wrong

am 12.09.2008 07:58:54 von George.Pitcher

Hi,

>| (This is my connections.php)


>| require_once("Connections/connection.php");  //database connection

>| Warning: require_once(Connections/connection.php)

>|
>| I have a feeling that my issue is contained within:  
>| (include_path='.;C:\php5\pear')

It might be a slip of typing but you say in your description that the
connection file is called 'connections.php', but you are calling
'connection.php'.

George


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: I don"t know what I"m doing wrong

am 15.09.2008 15:59:12 von John Harris

On 14 Sep 2008 8:07, Daniel Wagner wrote outside the list

> the "connection.php" is inside of a subdirectory called "connections" the
> "practice.php" is located inside the "images" folder both of those folders
> are the only folders (or files) contained under my "test" directory
>
> --- On Thu, 9/11/08, John Harris wrote:
>
> I can't see a problem if your connection.php file is located off the
> practice.php folder.
>
> C:\wamp\www\WebRoot\Test\Images\Connections\connection.php
>

So you have two solutions.

Specify the complete path to the connection.php file.
require_once("C:/wamp/www/WebRoot/Test/Connections/connectio n.php");

Or, tell the program to go up a directory level (../) to the Test folder
to start looking for the connection.php file.
require_once("../Connections/connection.php");

-John


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php