Forum Moderators: coopster

Message Too Old, No Replies

Should I hide the name of db table fields in <form>s?

         

Warboss Alex

1:36 pm on Jun 28, 2004 (gmt 0)

10+ Year Member



In a submission form, I've got this ..

[extract]

<form>
... etc
<input type="text" name="username">
<input type="text" name="email">
...
</form>

[/extract]

My database has two fields called userName and userEmail respectively, so part of the query is ..

$sql = " SELECT .. userName as username, userEmail as useremail .. ";

My question is, should I change the form/database field names to be identical and avoid all the 'as' statements in my sql query, or would it be more secure to leave them as they are? You can get the database field names from the <form> that way, but if you check the data thoroughly, it shouldn't matter though, should it?

It'd be easier if the names were same, since the table's got about 20 fields, each of them 'translated' with an -as- statement, and I'm just thinking it's all a bit unnecessary ..

Thanks in advance for any help!
Alex ...

Sanenet

1:49 pm on Jun 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As long as you're verifing the data correctly, it really doesn't matter.