-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
56 lines (51 loc) · 1.16 KB
/
insert.php
File metadata and controls
56 lines (51 loc) · 1.16 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
//select row
//echo 'hello'.'<br>';
require 'config/config.php';
require 'config/connect.php';
$counter=0;
$query=" SELECT `advisor_name` FROM `advisor` WHERE 1 ";
//$query_run=mysql_query($query);
if($query_run=mysql_query($query))
{
//echo 'Query success';
if(mysql_num_rows($query_run)==NULL)
{
//echo 'No results found';
}
else
{echo mysql_num_rows($query_run);
print_r($query_run);
print_r($query_row=mysqli_fetch_assoc($query_run));
while($query_row=mysql_fetch_assoc($query_run))
{
echo $name=$query_row['advisor_name'];
$query4="INSERT INTO `list` (
`user_id` ,
`user_nm` ,
`role`
)
VALUES (
$counter++ , 'sfgbvdgfhgbvsfgv', 'sdsfdfdf'
)";
//$query4="INSERT INTO `project`.`list` ( `user_id`, `user_nm`, `role` ) VALUES ( '', '". $name ."', '". 'fac' ."' ) "&& $counter++;
if($query_run=mysql_query($query4))
{
echo 'Query success';
}
else
{
echo $counter++;
//echo 'Query ffailed';
//echo mysql_error();
}
}
echo $counter;
}
}
else
{
//echo 'Query failed';
//echo mysql_error();
}
?>