473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to insert data into mysql using text box by php ?

i think my code is right . but it cannot work.
always says .........undefine varialble:_POST
;;;;;
Expand|Select|Wrap|Line Numbers
  1.  $roll=$_POST['roll'];
  2. $name=$_POST['name'];
  3. $class=$_POST['class']; 
  4. $coll_name=$_POST['coll_name'];
i can't
please help me.
Oct 11 '07 #1
3 4762
kigoobe
67
Ummm ...

1. You get the error message when you fill up the form and hit submit or when you hit submit without filling up the form?

2. $_POST['var'] .. does it work in other pages?

3. You are sure that you have set the action of your form as post, and not get?

4. What happens if you add error_reporting(0); at the top of your php page (just after <?php) ?
Oct 11 '07 #2
bergy
89
Do what Kigoobe suggests, if it's still not working, check your PHP version, if you're using a version less than 4.1.0 you'll have to use $HTTP_POST_VARS instead of $_POST. You can check your PHP version by typing the code below in a new PHP file:

[PHP]<?php phpinfo(); ?>[/PHP]
Oct 11 '07 #3
Motoma
3,237 Expert 2GB
i think my code is right . but it cannot work.
always says .........undefine varialble:_POST
;;;;;
$roll=$_POST['roll'];
$name=$_POST['name'];
$class=$_POST['class'];
$coll_name=$_POST['coll_name'];

i can't
please help me.
You haven't actually performed a POST operation to get to the PHP page. POST operations happen when you click a SUBMIT button in a FORM that has its METHOD tag set to POST and its ACTION tag set to the PHP page.

If you don't know what I am talking about, you will need to explain what you are trying to accomplish with your page.
Oct 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
2
by: Tavish Muldoon | last post by:
What a pain trying to insert data into a table from a stored proc. My webform asks for 16 pieces of data - which then gets written to the database. I found this easier than the crap below...
1
by: Joe | last post by:
Hello All, I am trying to insert a record in the MS Access DB and for some reason I cannot get rid of error message, System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. ...
3
by: Materialised | last post by:
Hello everyone, I am having a issue inserting values into a MYSQL table, and for the life of me, I can figure out why. I know the connection is successful, however I am getting errors. The...
2
by: bballr | last post by:
I have a problem that I'm not sure if it can be done. I'm trying to use the MySQL C API to be able to use a normal sql insert statement that will send the data or file to a directory and NOT the...
2
josie23
by: josie23 | last post by:
Egad, I'm not a coder/programmer by nature or occupation but understand things like html and css and a small amount of perl. So, basically, I'm a perl/mysql imbecile. But, I've been trying to...
7
by: dongletran06 | last post by:
Hi, Please help me find out what wrong with my codes in inputting from my form to mysql database using drop down menu. Below is the codes I used. Only the drop down is not working but the "input...
2
by: blitzztriger | last post by:
Hello!! how do i insert values into mysql , after parsing a submiting textbox?? I made the arrays, so this should be a basic insertion of them in the db, but something is missing, or in the wrong...
0
by: brianrpsgt1 | last post by:
I am attempting to insert data from a HTML form using a .psp script. I can not find how to link the data that is inserted into the form to the variables in the .psp script to then insert into the...
18
by: dbdb | last post by:
hi guys, i just new in asp.net world. i have an error for my first web test. here my code : sub OnBtnSendClicked (s As Object, e As EventArgs) Dim strConn As String =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.