Page 1 of 1

First databe using PHP interface

Posted: Mon Dec 17, 2007 9:46 am
by seriousdamage
Hi,
I would like to build my first database but I need a chick Start.
The goal is to create the DB using MYphp admin, I can do this.

Where I need help is with the php interfaces to call the SQL queries.

I would like to have 4 pages.
1 - The front page.php with a search field and a submit button to search the records records.
2 - The output page.php with the result of the search and every record should have two buttons affiliated, one to delete and one to modify.
3 - The modify page.php which will allow me to change the record and re-submit it.
4 - The add record page.php to add records to the database.

If someone could show me those pages with just one field,
I could then look at how is made and start adding the extra fields.

I have looked in google, but all example are so advanced that as soon as I try to change something, it starts going wrong.
I would like to have it at the most simple state as possible.

Thanks so much for your help.

Regards
Nic

Posted: Mon Dec 17, 2007 1:37 pm
by aliasxneo
http://www.freewebmasterhelp.com/tutorials/phpmysql

I would start with basic tutorials like that. It covers most of what you need, inserting, updating and deleting. You'll need to understand the basics of how to query the database and get results in a managable format before moving onto trying to implement the search. A VERY basic search would look like:

Code: Select all

<?php

$query = "SELECT * FROM `table` WHERE `name` LIKE('%query%')";
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result))
{
     print_r($row);
}

?>