Index
» Projekty
» phpMyEdit
» Fórum
» How to manipulate two field value strings? |
|
devkbsc
Založený: 30.12.2014
Príspevky: 7
Zaslal: 2015-02-18 14:39
Návrat hore
Odpovedať s citátom
|
Hello,
I have two fields in my form. The first one is
- firstname : Arnold
- lastname : Schwarzenegger
Donc the third field called "username" has to be automatically store in the datebase just by using this formula
- first letter of my "firstname" continued by the lastname
Result
username : SARNOLD
how to manipluate in the way of phpmyedit? any suggestions please?
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2015-02-18 15:45
Návrat hore
Odpovedať s citátom
|
Search the forum for examples using CONCAT and try using it with MySQL LEFT. Though the logic for using non unique usernames may cause you problems later.
|
devkbsc
Založený: 30.12.2014
Príspevky: 7
Zaslal: 2015-02-24 11:02
Návrat hore
Odpovedať s citátom
|
Hello,
Here i have tried just what you have told. But i have got a a blank page.
this is my source code
/*$opts['fdd']['username'] = array(
'name' => "Nom d'utilisateur",
'select' => 'T',
'input' => 'R',
'maxlen' => 25,
'sort' => true
);*/
$opts['fdd']['username'] = array (
'name' => "Nom d'utilisateur",
'sql' => 'CONCAT(LEFT(prenom)," ",nom)',
'options' => 'VDL',
'escape' => false,
'sort' => true
);
the first generated source is commandated. I have executed the program. i have got the following error
MySQL error 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')," ",last_name) AS `qf4`,`PMEtable0`.`email` AS `qf5`,`PMEtable0`.`fonction` AS' at line 1
if i merged all those propertied together as follow
$opts['fdd']['username'] = array (
'name' => "Nom d'utilisateur",
'sql' => 'CONCAT(LEFT(prenom)," ",nom)',
'options' => 'VDL',
'escape' => false,
'sort' => true
'select' => 'T',
'input' => 'R',
'maxlen' => 25,
);
i have got a blank page finally. Can please help to find my error?
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|