Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
eb0cc5c6
Commit
eb0cc5c6
authored
Aug 18, 2021
by
ludovic
Browse files
Update migrate_expeditor_data.php
parent
1ef3ce8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/maj/migrate_expeditor_data.php
View file @
eb0cc5c6
...
...
@@ -39,7 +39,7 @@ function main($argv)
$dbconn
=
pg_connect
(
'host='
.
$file
[
'server'
]
.
' dbname='
.
$file
[
'name'
]
.
' port='
.
$file
[
'port'
]
.
' user='
.
$file
[
'user'
]
.
' password='
.
$file
[
'password'
])
or
die
(
'Connexion impossible : '
.
pg_last_error
());
$query
=
'SELECT res_id,
initiator
FROM res_letterbox'
;
$query
=
'SELECT res_id,
typist
FROM res_letterbox'
;
$result
=
pg_fetch_all
(
pg_query
(
$query
));
$count
=
count
(
$result
);
$i
=
0
;
...
...
@@ -53,7 +53,7 @@ function main($argv)
}
function
updateExpediteur
(
$row
)
{
$select
=
"SELECT lastname || ' ' || firstname as expediteur FROM users WHERE id = "
.
$row
[
'
initiator
'
];
$select
=
"SELECT lastname || ' ' || firstname as expediteur FROM users WHERE id = "
.
$row
[
'
typist
'
];
$res
=
pg_query
(
$select
)
or
die
(
'Échec de la requête : '
.
pg_last_error
());
$expe
=
pg_fetch_all
(
$res
)[
0
][
'expediteur'
];
echo
" / expediteur : "
.
$expe
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment