First databe using PHP interface

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
seriousdamage
Forum Commoner
Posts: 30
Joined: Sat Nov 27, 2004 10:18 am

First databe using PHP interface

Post 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
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post 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);
}

?>
Post Reply