enter value from form to database table..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rrn
Forum Commoner
Posts: 46
Joined: Wed Apr 15, 2009 7:54 am

enter value from form to database table..

Post by rrn »

in my php page , there is a form for entering email , shown below ..
whenever a user enters email , i need to add tat to my database table 'log_table'.

Code: Select all

<tr><td>email</td><td><input type="text" id="email" name="email" value=""/></td></tr>
to add to table , i used the following query

Code: Select all

sql_query("INSERT INTO log_table (email) VALUES ('$_POST['email]')");
 
but it doesnt work.. pls give me a solution ..
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: enter value from form to database table..

Post by jraede »

What type of SQL database are you using?
Kurby
Forum Commoner
Posts: 63
Joined: Tue Feb 23, 2010 10:51 am

Re: enter value from form to database table..

Post by Kurby »

What part doesn't work? Does it give an error message? What happens? Is your form set to POST and posting to the right form?
lshaw
Forum Commoner
Posts: 69
Joined: Mon Apr 20, 2009 3:40 pm
Location: United Kingdom

Re: enter value from form to database table..

Post by lshaw »

Is sql_query a function?

do you mean mysql_query (for mysql) or mssql_query(for microsoft sql)
Post Reply