Re: breakthrough: get record, insert on different table works
| From: | Roberto Mansfield | Date: | Thu, 26 Apr 2007 13:56:43 +0000 |
| Subject: | Re: breakthrough: get record, insert on different table works | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-253858@lists.php.net to get a copy of this message | ||
Thufir wrote:
> it ain't pretty, but it's like a sugar rush! Finally, able to enter data on
> forms which I can create :)
>
[snip]
>
> Any thoughts/suggestions/advice as a next step? I need to add a timestamp when
> the data's entered, but that's a small thing. This is adding notes onto
> craigslist rss feeds database using
> <http://code.google.com/p/feed-on-feeds/>,
> which is an amazing app.
The next step? Go back and refine your code so that it IS pretty. You'll
get a much better understanding of coding. Just because code works,
doesn't mean you are finished.
Two obvious things you can fix:
1. Put your database and username password (or create a function to
setup the database connection) in a separate file which gets called by
your two scripts. When your database password changes, you just need to
change the password in one place. Not a bid deal in this case, but
imagine if you had 10 pages, 100 pages, etc...
2. You need to validate user input before including it in your sql
statements.
Good luck,
Roberto