A Test Page For PHP Immidiately

Here's the situation, I have a server (which I shall leave named x) which has phpMyAdmin on it. I need help getting a test page from one of you or on the Internet that has some basic PHP functions that I can use, like making a new table in a database, and pulling that information. I need this page because I'm a beginner and need a page like this that can help me learn some of the working characteristics of this language. I also am looking for a GOOD guide on PHP, have NOT found ANY yet. What can you do for me?

Nicolae Crisan,
crisann@mxtech.net
MxTechnical Computer Soltuions,
www.mxtech.net
LVL 1
ncwhizAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrjoeCommented:
Try the php.net tutorial for a start.

http://www.php.net/manual/en/tutorial.php

Greetz
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrjoeCommented:
0
ncwhizAuthor Commented:
great stuff! Answered many questions! BUT one thing, when connecting to a database, where do you put the code for connecting to that database? Do you put it in a separte file, or just with your html? example "connect.php"? What i do? Here's an example of code they site gave me.

$username="username";
$password="password";
$database="your_database";

Such and such...

I have some code, but what do I do now? stick it into my php file example (index.php) or do i have to put it into a seperate file and then pull that file first and do a redirect? What's the score here? How do I do this, so i can be able to enter information into my database as quickly as possible.

Thanks For All The Previous Help,
NcWhiz
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

lozlozCommented:
you can do all in the connecting in a seperate file then include the file on each php page by using the include function, e.g. include("connect.php");

my usually looks something like this:

<?
$db_user = "user";
$db_pass = "pass";
$db = "db";
$host = "localhost";
$link = mysql_connect($host,$db_user,$db_pass) or die("Database connection broken");
mysql_select_db($db,$link) or die("Database connection unavailable - " . mysql_error());
?>

you can put all your php code into index.php and it will be parsed by the engine and converted into html for the user to see. inserting data based on user inputs will need some forms which can then be parsed by php and and inserted into mysql
0
ncwhizAuthor Commented:
so like this ...
<?php
include (connect.php)
?>

Like that?
0
lozlozCommented:
<?php
include("connect.php");
?>

you need the semi colon and the quotes, and the file needs to be in the same directory as the script you're running, if not you need the change string in the include function to have the path info as well. useful tip: if you want to read up about a function go to www.php.net/functionname where functionname is the function you want more info about.. so www.php.net/include for this one
0
ncwhizAuthor Commented:
and one more thought, where's the close (); part on this code? shouldn't that be there in there somewhere? I don't want to kill my hosts server!
0
lozlozCommented:
the function is called mysql_close();

quoting from the manual:

Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. See also freeing resources.

i never use it
0
ncwhizAuthor Commented:
Ahhh!! Cool, this is cool! I'm getting it!! Cha-Ching!! Thanks a ton!... I'll post back for more ques.
0
ncwhizAuthor Commented:
One more comment, HOW CAN YOU MAKE SURE that you have a working connection?
0
lamdorCommented:
Hey ncwhiz,

 What was your question (A Test Page For PHP Immidiately?)
and where you have lead it? (One more comment, HOW CAN YOU MAKE SURE that you have a working connection?)..

 see its not fair..

 ask more questions..don't lead one question into multiple..
 I think if u open new question then you will get good answers..

okay..

with regards
lamdor.
0
kohashiCommented:
from lozloz:

?
$db_user = "user";
$db_pass = "pass";
$db = "db";
$host = "localhost";
$link = mysql_connect($host,$db_user,$db_pass) or die("Database connection broken"); *RIGHT HERE TELLS YOU THAT YOU HAVE A WORKING CONNECTION OR DO NOT.  "or die" tells it to quit, it will show an error.*
mysql_select_db($db,$link) or die("Database connection unavailable - " . mysql_error());
?>

hope that helps,
-kohashi
0
kohashiCommented:
http://directory.google.com/Top/Computers/Programming/Languages/PHP/Tutorials/

A list of PHP tutorials :)

hope that also helps,
-kohashi
0
ncwhizAuthor Commented:
Okay, I gave the points to marjoe, because this user had the best answer to this question, however, lolz helped me the most in the detials, So I'll start some new questions, so Lolz can get some points as well. Sorry about that.
0
mrjoeCommented:
Thanks, good thinking about starting some new questions, and good luck with php!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.