Re: Where do I start




George Mills wrote:
George Mills wrote:
will.beard@xxxxxxxxxx wrote:

Hi all I want to be able to write a database driven website. Is there
any software or books for beginners that anyone can recommend. I am mac
based using OS X 10.3.6

Beginner? How beginner? Do you have a server you can test your php on?
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. :)

.



Relevant Pages

  • Re: following radio & hidden does not work..... help please.
    ... So you query the database for records and present the concatenated fname and lname for the user to choose from. ... This works the same with a radio button or a select statement. ... This is a HTML or PHP question! ...
    (alt.html)
  • Re: Indent HTML portions question
    ... > the portion of the HTML where I jump out of php mode and back in again. ... // Connect to the database. ... errorMessage("One or more required fields were left blank. ...
    (comp.lang.php)
  • Re: Why not generate static pages instead of dynamic?
    ... html pages out there now, ... But querying a database, ... is fetched through AJAX or a 'more-dynamic' page (php ... dynamic/user-interaction page or not, and on that basis will serve the html ...
    (comp.lang.php)
  • Re: following radio & hidden does not work..... help please.
    ... Using a HTML radio button form as previously stated returns all the data as requested. ... The problem seems to be HOW does one get more than one database variable to be to the PHP action program. ... The objective of the form is to use either a or a radio button form so a user can select a person from the database. ...
    (alt.html)
  • Re: Accessing Class Method
    ... public $database; ... public $html; ...
    (comp.lang.php)