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

multiple row insert

hi friends,

this my code.. i want insert multiple record.. how can i? plz send me the solution..
<?
for($i=0;$i<$count;$i++)
{
$n++;
$id=mysql_result($res,$i,trainer);
$participant=mysql_result($res,$i,participant);
$fromdate=mysql_result($res,$i,fromdate);
$todate=mysql_result($res,$i,todate);
?>
<tr > <form name="attend" action="attendance_view_action.php" method="post">
<td class="font_align" align="center"><? echo $n; ?></td>
<td class="font_align"><? echo $participant; ?></td>
<td class="font_align"><? echo $trainer; ?></td>
<td class="font_align"><? echo $fromdate; ?></td>
<td class="font_align"><? echo $todate; ?></td>
<input type="hidden" name="participant" value=<? echo $participant; ?>>
<input type="hidden" name="trainer" value=<? echo $trainer; ?>>
<input type="hidden" name="fromdate" value=<? echo $fromdate; ?>>
<input type="hidden" name="todate" value=<? echo $todate; ?>
<td class="font_align"><input type="text" id="attend_date" name="attend_date" maxlength="10" size="10"><a href="javascript:NewCal('attend_date','ddmmyyyy',f alse,24)"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
<td class="font_align"><input name="attendance" type="checkbox"></td>

</tr>
<?
} ?>
<tr> <td class="font_align" colspan="7" align="right"><input name="submit" type="submit" value="Insert"></td></tr>
</form>
<?}
else
{?>

<tr>
<td>Attendance Not Found</td>
</tr>

<? }
?>
Oct 3 '06 #1
1 1510
ronverdonk
4,258 Expert 4TB
This surely is not all your code. You did not include the MySql code to read your data and you did not include any of the form handling code that processes your submitted form and supposedly performs an insert (or is it an update?). Also: what do you already have for the insert/update?

Please show all your code (within [code] or [php] tags!) and we can all have a look.

Ronald :cool:
Oct 4 '06 #2

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

Similar topics

7
by: RotterdamStudents | last post by:
Hello there, i have a strange problem. I can't get php to insert multiple rows at once in a MySQL database. I use the $sql = "INSERT INTO database (a,b,c,d,e) VALUES ('$a', '$b' ,'$c', '$d',...
3
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax:...
10
by: shank | last post by:
I have a recordset that contains multiple records of product a user is purchasing. For clarity, I converted the recordset fields to variables. I need to take that entire recordset and insert it...
2
by: Joe | last post by:
Hey, I'm going to give some background on my situation in case anyone can point out a way around my problem altogether... for the problem itself, please skip to the bottom of the post. thanks....
1
by: John Smith | last post by:
I have a user assigned multiple roles and a role can be inherited from multiple parents (see below). How do I answer such questions as "How many roles does the user belongs to?" I answered the...
3
by: DarthMacgyver | last post by:
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection...
5
by: Arsen V. | last post by:
Hello, What is the optimal way to insert multiple rows (around 1000) from a web application into a table? The user enters multiple lines into a text box (up to 10,000). The ASP.NET...
10
by: ads | last post by:
hi, after binding the dropdownlist to a datasource, ive experience this error "Cannot have multiple items selected in a dropdownlist" after using the code:...
2
by: Diego | last post by:
Hi everybody! I'm using DB2 PE v8.2.3 for linux. I've defined a database with the following schema: ANNOTATION(ID,AUTHOR,TEXT) ANNOTATION_BOOK(ANNOTATION_ID,OBJECT_ID)...
58
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also...
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
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...

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.