its working now.. i have dbconnection file the coding is as below <? mysql_connect("localhost", "database", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); ?> i want include this file in ur coding. but it seems not working, plz guide me
replace these two lines from my code... $conns=mysql_connect("localhost", "root", "root") or die(mysql_error()); mysql_select_db("webzwork_red") or die(mysql_error()); and put there these lines $conns=mysql_connect("localhost", "database", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error());
he can use 'text' as many times as he wants ..because its the type="text" telling the <input> what type of data is used At the beginning of this thread, you posted your username and password to database in your connect file perhaps. when putting the data into the databasefields instead of saying WHERE 'users' ... try to be more specific. if you had a form with say first_name , last_name, and email mysql_query ("INSERT INTO users (first_name, last_name, email ) VALUES ( '$first_name', '$last_name', '$email' )") or trigger_error('Error with insert: '.mysql_error(),FATAL) ; Tell it WHERE its putting them in the 'users' table so that the names of the fields in your database match so say you had a database with: First_Name , Last_Name, Email then you would do it like this mysql_query ("INSERT INTO users (First_Name, Last_Name, Email ) VALUES ( '$first_name', '$last_name', '$email' )") or trigger_error('Error with insert: '.mysql_error(),FATAL) ; doesnt matter as long as the fields coorespond in linear order to the right variables - but its better practice to make them match exactly..so theres no problems
you got no problem on your form, the problem is that you forgot to add fields, like insert into table(FIELD1,FIELD2,FIELDn) values('$var1','$var2','$varN');