Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1300440
select_table_columns.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 19, 1:53 PM
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Nov 21, 1:53 PM (5 h, 35 m)
Engine
blob
Format
Raw Data
Handle
294247
Attached To
rDIAS DIAS
select_table_columns.php
View Options
<?php
require_once
(
"../db_connect.php"
);
global
$dbh_portal
;
$tds
=
''
;
foreach
(
$_POST
[
'checked_tds'
]
as
$item
){
if
(
$tds
==
''
)
$tds
=
$item
;
else
$tds
=
$tds
.
","
.
$item
;
}
$userid
=
(
isset
(
$_SERVER
[
'persistent-id'
])
?
$_SERVER
[
'persistent-id'
]
:
null
);
$sth
=
$dbh_portal
->
prepare
(
"SELECT user_id FROM search_columns;"
);
$sth
->
execute
();
$sth
->
setFetchMode
(
PDO
::
FETCH_ASSOC
);
$flag
=
0
;
while
(
$row
=
$sth
->
fetch
()){
if
(
$row
[
'user_id'
]
==
$userid
)
$flag
=
1
;
}
if
(
$flag
==
1
){
$sth
=
$dbh_portal
->
prepare
(
"UPDATE search_columns SET table_name = ?, columns = ? WHERE user_id = ? ;"
);
$sth
->
bindParam
(
1
,
$_POST
[
'table'
],
PDO
::
PARAM_STR
);
$sth
->
bindParam
(
2
,
$tds
,
PDO
::
PARAM_STR
);
$sth
->
bindParam
(
3
,
$userid
,
PDO
::
PARAM_STR
);
$sth
->
execute
();
}
else
{
$sth
=
$dbh_portal
->
prepare
(
"INSERT INTO search_columns (user_id, table_name, columns) VALUES (?, ?, ?)"
);
$sth
->
bindParam
(
1
,
$userid
,
PDO
::
PARAM_STR
);
$sth
->
bindParam
(
2
,
$_POST
[
'table'
],
PDO
::
PARAM_STR
);
$sth
->
bindParam
(
3
,
$tds
,
PDO
::
PARAM_STR
);
$sth
->
execute
();
}
?>
Event Timeline
Log In to Comment