473,321 Members | 1,669 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,321 software developers and data experts.

here i want to transfer multiple textbox box in a mysql database using php coding...

1
<?php
$connection=mysql_connect("localhost","root") or die( mysql_error() );

mysql_select_db("studentmgmt",$connection )or die( mysql_error());

$res=mysql_query("select * from studentmgmt.add where deptt='I.T'");
$id='';
echo"<br><br><br><br><br>";
echo"<table align='center' border='1'>";
echo"<form method='post' action=''>";
echo"<th>Name</th><th>Roll no</th><th>Attendence</th>";
while($row=mysql_fetch_array($res))
{
echo"<tr><td>$row[name]</td><td>$row[rollno]</td><td><input type='text' name='at[]'></td></tr>";
}
echo"<tr><td><input type='submit' name='submit'></td></tr>";
echo"</form>";
echo"</table>";

if($_REQUEST['submit'])
{
$attendence[]=$_REQUEST['at[]'];
mysql_query("insert into studentmgmt.attendenceit(name,rollno) select name,rollno from studentmgmt.add where deptt='I.T'")or die(mysql_error());
mysql_query("insert into studentmgmt.attendenceit(attendence) values('$attendence[]'") or die(mysql_error());
$res=mysql_query("select * from studentmgmt.attendenceit");

/*for($i=0;$i<=mysql_num_rows($res);$i++)
//while($row=mysql_fetch_array($res))
{
$attendence[$i]=$_REQUEST['at[$row]'];
mysql_query("update studentmgmt.attendenceit set attendence='$attendence[$i]'")
or die(mysql_error());
}*/
}

?>
Nov 28 '11 #1
1 1761
omerbutt
638 512MB
Hi ,
please use [code] tags to wrap your code inside , and whats the problem with the above code, what errors are you facing any detail,you must provide sufficent detail while asking a question and please read the Please Read Before Posting - Forum Etiquette & Useful Stuff once before posting a question.
regards,
Omer Aslam
Nov 28 '11 #2

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

Similar topics

11
by: menmysql | last post by:
i am getting the following error while connecting mysql database using jsp java.sql.SQLException: Communication link failure: Bad handshake can any one tell what is the actual problem
8
by: menmysql | last post by:
i am not bale to solve this problem since two weeks i am trying to access records from mysql database using jsp. inside this jsp program i wrote all my JDBC code. it is working very nicely and...
9
by: christopher_board | last post by:
Hi all. I am trying to connect to a MySQL Database using PHP on a local machine using locahost. I am using the following code <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass =...
2
by: zalina | last post by:
hai..does anyone have example how to connect to mysql database using c++ language?
3
by: Suresh P | last post by:
Hi All, I tried to access the mysql database in ODBC using ip address and username/password. It returns, "cannot connect to MySQL server on IP ADDRESS(10060)". This could be related to Firewall...
2
by: maheshonmail | last post by:
i want to store pictures in mysql database using php code/ so please send me the most efficient code for doing this.
1
by: nadeenahmed | last post by:
I have Connected to a MySQL Database using a neatbeans editor. Now, I want to use that same database I created earlier on another pc. Can anyone help and tell me how that is done, please? Thank...
1
by: twinkle2010 | last post by:
Hi I am a new web programmer.I got an issue that reads the excel sheet data and store it to MYSQL database using php. I dont have any idea on that. can you help me?
6
by: mfaisalwarraich | last post by:
Hi everyone, I am trying to add multiple pinpoint to google map using Lon/Lat. All addresses will be fetched from mysql database using PHP. I have looked at google and searched for it on...
1
by: santhanalakshmi | last post by:
Hi, I wrote some coding, to import excel data in mysql database using PHP Script? But my script, its not all inserting the excel data in mysql database. I don't know, what mistake did i made?...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.