Re: Where do I start
- From: will.beard@xxxxxxxxxx
- Date: 8 May 2006 07:25:08 -0700
George Mills wrote:
George Mills wrote:
will.beard@xxxxxxxxxx wrote:
Hi all I want to be able to write a database driven website. Is thereBeginner? How beginner? Do you have a server you can test your php on?
any software or books for beginners that anyone can recommend. I am mac
based using OS X 10.3.6
Do you have a database? Have you every written a program? If so what
language(s)? Why a database driven website? Why php? What database would
you like to use? How's the weather? Single user or multiple user? Need
security? Do you know HTML? What editor do you use? How much money have
you got? What is your timeframe? Will lunch be provided? Did you get the
memo? No?!? That's ok, neither did I. :)
George
Here is everything you need to know. Glad to help.
(This is for mysql. If you need a different database go to
http://www.php.net/manual/en/funcref.php and find the reference for the
database you need.)
From:
http://www.php.net/manual/en/ref.mysql.php
(Sorry, I did not see a link to this section of the page so I reprinted it.)
Examples
This simple example shows how to connect, execute a query, print
resulting rows and disconnect from a MySQL database.
Example 1. MySQL extension overview example
<?php
// Connecting, selecting database
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');
// Performing SQL query
$query = 'SELECT * FROM my_table';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>
Beginner? yes (I can do general web design, I can read html but not
write it)
How beginner? very (I didnt understand any of those scripts)
Do you have a server you can test your php on? yes
Do you have a database? no
Have you every written a program? If so what language(s)? no
Why a database driven website? there will be alot of information
entered into catagories and it needs to be able to be listed and found
quickly.
Why php? I have heard it works well with what I want to do.
What database would you like to use? I dont understand that question.
How's the weather? Sunny, it rained earlier though.
Single user or multiple user? multiple
Need security? yes
Do you know HTML? not very well
What editor do you use? Dreamweaver
How much money have you got? I'm not telling you, Ive got 56p in my
back pocket.
What is your timeframe? there isnt one its a personal project.
Will lunch be provided? no
Did you get the memo? What memo
No?!? That's ok, neither did I. :)
.
- Follow-Ups:
- Re: Where do I start
- From: DonO
- Re: Where do I start
- References:
- Where do I start
- From: will . beard
- Re: Where do I start
- From: George Mills
- Re: Where do I start
- From: George Mills
- Where do I start
- Prev by Date: Re: Where do I start
- Next by Date: Re: Where do I start
- Previous by thread: Re: Where do I start
- Next by thread: Re: Where do I start
- Index(es):
Relevant Pages
|