hi, i need a help urgent because monday i´m going to have a job test
i need to know how make a crud system
i don´t know if i´m going right if someone can help me its gonna be ok
i´ve created various files php...
1 to make conection with, 1 to insert, 1 to edit, 1 to delete, 1 to show the register and 1 to be my input form
So i imagined to put in my form and call the file of form and file of insert to insert
And this going....to the rest
I´m doing the right?
Thanks
crud for newbie
Moderator: General Moderators
Re: crud for newbie
Not quite sure what you're asking for, but
A typical CRUD system works like:
As long as you have those four mechanisms the system counts as CRUDy. Whatever the code actually looks like, whatever the various PHP files look like.
A typical CRUD system works like:
Code: Select all
Index page
--> [R]ead a particular record
--> [U]pdate the record
--> [D]elete the record
--> [C]reate a new record-
macario1983
- Forum Newbie
- Posts: 6
- Joined: Fri Aug 17, 2012 5:22 pm
Re: crud for newbie
requinix wrote:Not quite sure what you're asking for, but
A typical CRUD system works like:As long as you have those four mechanisms the system counts as CRUDy. Whatever the code actually looks like, whatever the various PHP files look like.Code: Select all
Index page --> [R]ead a particular record --> [U]pdate the record --> [D]elete the record --> [C]reate a new record
my doubt is about how can i use make my system
because i create 3 files, each one to insert, update and delete
so insert and update can use the same form no?
Re: crud for newbie
How you combine or do not combine functionality in script files is beyond the concept of CRUD. Yes, often some or all of those functions can be combined in a single file, using the response of the user to determine which section of code is executed, but that is a matter of choice for the developer, it doesn't change the concept of CRUD in any way, as long as those 4 capabilities are present.
-
macario1983
- Forum Newbie
- Posts: 6
- Joined: Fri Aug 17, 2012 5:22 pm
Re: crud for newbie
i´ve found yesterday on google one code and made my code like that
I want to know if there is better way or i´m corret
For edit and delete i´ve imagine to make the same thing putting a radio with every register...
What do you think?
Thanks to everyone
Code: Select all
<form method="post" >
<fieldset>
<legend>Formulário de Cadastrado</legend>
<label>Nome: <input type="text" name="nome" /></label>
<label>Email: <input type="text" name="email"/></label>
<label>Telefone: <input type="text" name="telefone"/></label>
<input type="reset" value="Limpar" />
<input type="submit" value="Enviar" />
<input type='hidden' value='1' name='enviado' />
</fieldset>
</form>
<?php
include('configuracao.php');
if(isset($_POST['enviado'])){
$sql = "INSERT INTO contato (nome,email,telefone)
VALUES ('$_POST[nome]','$_POST[email]','$_POST[telefone]')";
mysql_query($sql);
}
?>
For edit and delete i´ve imagine to make the same thing putting a radio with every register...
What do you think?
Thanks to everyone
Re: crud for newbie
Does it work properly?
-
macario1983
- Forum Newbie
- Posts: 6
- Joined: Fri Aug 17, 2012 5:22 pm
Re: crud for newbie
i didn´t terminated my job because i have other problem that i opened other post to people help me...califdon wrote:Does it work properly?
but i hope to end this today