for($y=1;$y<=$x;$y++){
$query="insert into attendance values('$admission_no[$y]','$date','$state_id')";
$result=mysql_query($query);
}
sameeya007
0
Newbie Poster
Recommended Answers
Jump to PostWhat is the code supposed to be doing?
If $admission_no[$y] is only supposed to output the value of $y then you can replace "$admission_no[$y]" with just "$y".
Without more of the code and not knowing what it's supposed to do, we can't help much. Could you please provide …
Jump to Post$query="insert into attendance values('$admission_no[$y]','$date')";
Should be:
$query="insert into attendance(field1, field2) values('" . $admission_no[$y] . "','" . $date . "')";
You must select the field(s) to insert the value(s).
$var="variable $var"
and$var = "variable " . $var
are not same.
All 7 Replies
sameeya007
0
Newbie Poster
Borzoi
24
Posting Whiz
sameeya007
0
Newbie Poster
ko ko
97
Practically a Master Poster
sameeya007
0
Newbie Poster
sameeya007
0
Newbie Poster
paulrajj
6
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.