crescent
-
Posts
8 -
Joined
-
Last visited
Never
Posts posted by crescent
-
-
[b]:::::::::[!--coloro:#FF9900--][span style=\"color:#FF9900\"][!--/coloro--]Here is my form[!--colorc--][/span][!--/colorc--]::::::::[/b]
[code]<FORM name="f1" METHOD=POST onSubmit="return EW_checkMyForm(this);" ACTION="action.php">
<P align="center">
<TABLE width="896" border=1 bordercolor="#FFC497">
<!--DWLayoutTable-->
<TR bgcolor="#E45F05">
<TD height="23" colspan="6" align="center" valign="top"><FONT SIZE='2' face='verdana' color="#FFFFFF"><B>Add
New Student Info.</B></FONT></TD>
</TR>
<TR>
<TD width="38" height="28"> </TD>
<TD width="94"> </TD>
<TD width="247"> </TD>
<TD width="155"> </TD>
<TD width="69"> </TD>
<TD width="253"> </TD>
</TR>
<TR>
<TD height="26" colspan="2"><FONT SIZE='2' face='verdana'>Name</FONT></TD>
<TD colspan="4" valign="top"><INPUT TYPE="text" cols=5 NAME="name" size="35"></TD>
</TR>
<TR>
<TD height="26"> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
</TR>
<TR>
<TD height="28" colspan="6" valign="top"><!--DWLayoutEmptyCell--> </TD>
</TR>
<TR>
<TD height="44" valign="top">SL</TD>
<TD colspan="2" valign="top"><font size='2' face='verdana'>Choice</font></TD>
<TD valign="top"><font size="2" face="verdana">Cost</font></TD>
<TD> </TD>
<TD> </TD>
</TR>
<TR>
<TD height="28" valign="top"><font size='2' face='verdana'>1</font></TD>
<TD colspan="2" valign="top"><font size='2' face='verdana'>
<select name='i_name[]' id="i_name[]" onChange="setCredit(cr0,this.value)">
<option value=''>Select one</option>
<?php
setCrList();
?>
</select>
</font></TD>
<TD valign="top"><font size="2" face="verdana">
<input name="cr0" type="text" id="txt1" value="0" size="25" >
</font></TD>
<TD> </TD>
<TD> </TD>
</TR>
<TR>
<TD height="28" valign="top"><font size='2' face='verdana'>2</font></TD>
<TD colspan="2" valign="top"><font size='2' face='verdana'>
<select name='i_name[]' id="i_name[]" onChange="setCredit(cr1,this.value)">
<option value=''>Select one</option>
<?php
setCrList();
?>
</select>
</font></TD>
<td valign="top"><font size="2" face="verdana">
<input name="cr1" type="text" id="cr1" value="0" size="25">
</font></td>
</TR>
<TR>
<TD height="36" valign="top"><font size='2' face='verdana'>3</font></TD>
<TD colspan="2" valign="top"><font size='2' face='verdana'>
<select name='i_name[]' id="i_name[]" onChange="setCredit(cr2,this.value)">
<option value=''>Select one</option>
<?php
setCrList();
?>
</select>
</font></TD>
<td valign="top"><font size="2" face="verdana">
<input name="cr2" type="text" id="cr2" value="0" size="25">
</font></td>
</TR>
</TR>
<TR>
<TD height="47" colspan="6" valign="top"><div align="center"> <br>
<input name="submit" type="submit" value="Submit">
<input name="reset" type="reset">
</div></TD>
</TR>
<TR>
<TD height="12"></TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
</FORM>[/code]
-
Here is my table and code
:::::Table Structure::::
[code]CREATE TABLE `_item` (
`SL` int(11) unsigned NOT NULL auto_increment,
`item_name` varchar(100) NOT NULL default '', PRIMARY KEY (`SL`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5;
CREATE TABLE `_name` (
`SL` int(11) unsigned NOT NULL auto_increment,
`user_name` varchar(100) NOT NULL default '', PRIMARY KEY (`SL`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5;
[/code]
:::Code::::
[code]
for($i=0;$i<count($_POST['i_name']);$i++)
{
$str=explode("#",$_POST['i_name'][$i]);
$i_name=$str[1];
if(($i_name<>""))
{
$sql="insert _item(item_name) values ('$i_name')";
$rs=mysql_query($sql);
}
}
if($rs){
$sql1="insert into _name(user_name) values ('$name')";
mysql_query($sql1);
}
[/code]
Please tell me now I will I do that
-
I have created a submitting form from where user input his name and his choice (eg. pen, pencil, notebook). he have to choose two item from this three item. But the matter is if a item is already choosen by 10 user so that item will not be inputting into database table and he will get a massege.
any body help me please how will I set my logic and code. -
Dear Friend
Thanks for ur excellent reply. Here is my table structure...which will be more easier for me to use.
[code]
CREATE TABLE `_student_info` ( `st_sl` bigint(20) NOT NULL auto_increment, `st_id` varchar(25) NOT NULL default '', `st_name` varchar(50) NOT NULL default '', `st_sem` char(3) NOT NULL default '', PRIMARY KEY (`st_sl`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
CREATE TABLE `_student_reg_info` ( `st_id` varchar(25) NOT NULL default '', `st_coursecode` varchar(10) NOT NULL default '', `st_coursecredit` varchar(10) NOT NULL default '', `st_coursesection` char(2) NOT NULL default '', `st_date` varchar(20) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; [/code]
[code]
for($i=0;$i<count($_POST['cc']);$i++)
{
$cr="cr".$i;
$sec="se".$i;
$dt="dt".$i;
$str=explode("#",$_POST['cc'][$i]);
$cc=$str[1];
if(($cc<>"")&& ($_POST[$dt]<>""))
{
$sql="insert into _student_reg_info(st_id,st_coursecode,st_coursecredit,st_coursesection,st_date) values('$dpt$id','{$cc}','{$_POST[$cr]}','{$_POST[$sec]}','{$_POST[$dt]}')";
//echo $sql."ada";
$rs=mysql_query($sql);
if($rs)
{
echo "Successfully added course code {$cc} for Student id= '$dpt$id'<br>";
}
else
{
echo "Failed";
}
}
}
$datetime=date("y-m-d h:i:s");
if($rs){
$sql1="insert into _student_info(st_id,st_name,st_sem,datetime) values ('$dpt$id', '$name', '$sem', '$datetime')";
//echo $sql."ada";
mysql_query($sql1);
}
[/code]
Feiends If I use the above code and table structure then how will I give the limitation to input that I described my first request.
Thanking You
-
Hello there!!!
I need your help.
I am working in a project of student admission using php & mysql. There are about ten subjects(like math, history, drama, music, science and so on) and 4 section(say A, B, C & D).
Now there has to be only 40 student with a certain subject in each section.
Exmaple:
40 student with math in section A
40 student with math in section B
40 student with math in section C
40 student with math in section D
Again
40 student with history in section A
40 student with history in section B
40 student with history in section C
40 student with history in section D
Again
40 student with drama in section A
40 student with drama in section B
40 student with drama in section C
40 student with drama in section D
And so on....
Now please tell me or suggest me how can I do this.
Thank you -
Hellow
in my user input form i want to restrict inputting data by user...for example
after 40 people submitting the form no user will be able to insert data(submit form)
how will i do it
plz help -
Hellow
I have create a database in MSSql 2000. I want to import this databaste into MySql with the help of PHPMyAdmin How will I do it .Anybody please help me out.
Regards
Looking for online newspaper system and online jobposting system
in Third Party Scripts
Posted
Hi
If you have the URL of the opensource of online newspaper system and online jobposting system Please send me.
'crescent'