forked from danalex97/Projects-Fall-2015
-
Notifications
You must be signed in to change notification settings - Fork 0
/
take_table.php
executable file
·32 lines (26 loc) · 933 Bytes
/
take_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
include ("_conect.php");
$qry = "select count(*) from $clasa";
$res = mysql_fetch_assoc(mysql_query($qry,$conn));
$students = $res['count(*)'];
for ($i=0;$i<30;++$i)
if ( $_POST["nume$i"] != null )
{
$act_name = $_POST["nume$i"];
$act_pren = $_POST["pren$i"];
$act_sex = $_POST["sex$i"];
/*$qry = "insert into $clasa (id,nume,prenume,sex,
preferinta1,preferinta2,preferinta3,antipatie1,antipatie2,antipatie3)
values ($students,$act_name,$act_pren,$act_sex,0,0,0,0,0,0)";*/
$qry = "insert into $clasa (id,nume,prenume,sex) values ($students,\"$act_name\",\"$act_pren\",\"$act_sex\")";
if ( mysql_query($qry,$conn) === false )
{
echo "Error: " . $qry . "<br>" . mysql_error($conn);
}
$students++;
}
mysql_close($conn);
?>
<html>
<iframe src="print_table.php" width="600" height="600"> </iframe>
</html>