Can somebody help me out with a beginners PHP Quiz for School?
“Use the information below to finish the input form. The user should be able
to add a new name and email record into the account table and display
the 10 newest records below the form.”
I have caught the increment typo and I think I got the form action. Is there anything I am missing? How do I get the 10 newest records to show below the form?
Thanks
[php]
class account{
function account(){
$this->id = ’ ';
$this->name = ";
$this->email = ";
}
function find_account($id){
$sql=“select ‘id‘ from ‘account‘ where ‘id‘=’”.$id."’";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$row[‘id’]; //int pk auto incerment increment
$row[‘name’]; //varchar(50)
$row[‘email’]; //varchar(50)
$row[‘timestamp’]; //varchar(15)
}
}
}
[/php]
<htm|>
<body>
<div>
<form action='#'> [b]<form action="#" method="post">[/b]
name: <input type='text' name='account_name'>
email:<input type='text' id='account_email'>
<input type="button" value="submit">
</form>
</div>
<div style="border:solid 1px #F6O;">
Last 10 entry:
</div>
<div style="border:solid 1px #OOO;">
<?php echo "id: ".$account->id;?>
<?php echo "name: ".$account->name;?>
<?php echo "email: ".$account->email;?>
</div>
</body>
</htm|>