Page 9 of 13

Re: Video#2

Posted: Sun Feb 07, 2010 1:14 pm
by Bust
Great !!!
Your tutorials are great

:!: If your DataBase isn't called "Tutorial" put this code:
<?php

$db = mysql_connect("localhost","root","") or die("Could not connect to db");
if(!$db)
die("no db");
if(!mysql_select_db("YOUR DATABASE NAME HERE",$db))
die("No Database Selected");

?>

Re: Video#2

Posted: Tue Sep 21, 2010 3:39 am
by pmak
:D thank you so much for doing all of this, i'm pretty sure your the only guy out there doing it. Indie-Resource is awesome and really one of a kind. Keep on keeping on.

-pmak

Re: Video#2

Posted: Tue Sep 21, 2010 2:07 pm
by hallsofvallhalla
thanks I appreciate that!

Re: Video#2

Posted: Tue Jan 11, 2011 5:36 pm
by Slav2
Hey guys. firstly i'd like to thank hallsofvallshalla for doing this.....thankyou :) i just started watching these and im allready getting errors.....ill post everything here, and if someone could tell me what im doing wrong i would really apretiate it..

connect.php

Code: Select all

<?php

$db = mysql_connect("localhost","root","") or die("Could not connect to db");
if(!$db)
die("no db");
if(!mysql_select_db("tutorial",$db))
die("No Database Selected");

?>
test.php

Code: Select all

<?php
include 'connect.php';

$playerinfo ="select * from players where name = 'player1'";
$playerinfo2 = mysql_query($playerinfo) or die ("could not select players");
$playerinfo3 = mysql_fetch_array($playerinfo2);

echo "Player1's email is " . $playerinfo3['email'];
echo "<br>Player1's id is " . $playerinfo3['id'];

?>
and then this is what pops up when i open firefox: (http://localhost/tutorial.test.php)

---------------------------------------------------------------------------------------------------------------------

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
1/11/2011 12:34:51 PM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

---------------------------------------------------------------------------------------------------------------------

Re: Video#2

Posted: Tue Jan 11, 2011 8:55 pm
by alexander19
The address your're going to,does not exist http://localhost/tutorial.test.php....it should probably be http://localhost/tutorial/test.php

Re: Video#2

Posted: Tue Jan 11, 2011 9:24 pm
by Slav2
yea just tried that and it didnt work. :(

Re: Video#2

Posted: Tue Jan 11, 2011 11:36 pm
by alexander19
As long as the test.php script is inside the tutorial folder and you're reaching it correctly,I cant really guess what the problem could be. :|

Re: Video#2

Posted: Wed Jan 12, 2011 12:56 am
by Jackolantern
Yes, you need to recheck your folder structure and make sure your links are equal to your folder and file structure. Are you sure you saved the file when you changed the period to a slash? That error means the WAMP server is not finding the file you are linking to. It is not an error in the PHP code itself.

Re: Video#2

Posted: Fri Jan 14, 2011 6:04 am
by Slav2
Hmmm I'm going to double check everything tomorrow but I think I had everything setup perfectly.

Re: Video#2

Posted: Mon Jan 31, 2011 1:32 am
by Slav2
man this is annoying....ive tried doing this already so many times and i just cant get the local host thing to work. same error everytime.