MY Big Problem
Moderator: General Moderators
- Mastermind
- Forum Commoner
- Posts: 36
- Joined: Thu Mar 10, 2005 2:38 am
- Location: CDO,Philippines
- Contact:
MY Big Problem
Dear Friends,
I have a problem today about php there he is create a web site that will allow the user to enter the user to enter jokes.Each joke should have their own unique identifier and every joke entered should have a corresponding date entry in the database as well as the name of fields..
I have a problem today about php there he is create a web site that will allow the user to enter the user to enter jokes.Each joke should have their own unique identifier and every joke entered should have a corresponding date entry in the database as well as the name of fields..
I had a rant about this a while ago.
Here's the problem: you aren't good enough at PHP to attempt this yet.
What you want to do is really simple, so go and pick up a 'beginners PHP' book or look up a PHP tutorial on the net and actually learn the language, rather than just get told the bits of information you need.
Mmm'kay?
Here's the problem: you aren't good enough at PHP to attempt this yet.
What you want to do is really simple, so go and pick up a 'beginners PHP' book or look up a PHP tutorial on the net and actually learn the language, rather than just get told the bits of information you need.
Mmm'kay?
Tone down your arrogance, Grim. How about you help mastermind to find the solution, to coach him - or is that beyond what you think posting on this forum is all about?Grim... wrote:I had a rant about this a while ago.
Here's the problem: you aren't good enough at PHP to attempt this yet.
What you want to do is really simple, so go and pick up a 'beginners PHP' book or look up a PHP tutorial on the net and actually learn the language, rather than just get told the bits of information you need.
Mmm'kay?
However, in the spirit of good will, he could do worse than starting here:
http://www.tizag.com/phpT/
http://www.tizag.com/phpT/
Okay mastermind, here's what I'd do...
First, set up your database so that the 'jokes' table (or whatever) has a auto-incrementing index, called 'ID', a text field called 'Joke' and a long interger field called 'Date'.
Make a HTML form that asks for the joke (with a text area called 'joke'), and have it submit to a page called 'add.php'.
On add.php, you want something along the lines of:
When you want to get the date out again, use
The Id of the joke will be automatically inserted by the database.
This is not tested, but looks okay.
Good luck
First, set up your database so that the 'jokes' table (or whatever) has a auto-incrementing index, called 'ID', a text field called 'Joke' and a long interger field called 'Date'.
Make a HTML form that asks for the joke (with a text area called 'joke'), and have it submit to a page called 'add.php'.
On add.php, you want something along the lines of:
Code: Select all
<?php
//connect to your database here...
addslashes($joke);
$edate = mktime();
mysql_query ("INSERT INTO jokes (Joke, Date) VALUES ('$joke', '$edate')");
?>
Thanks for the joke!Code: Select all
<?php
date("M-d-Y", $the_number_from_the_database);This is not tested, but looks okay.
Good luck