Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 20. apríl 2024
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  How to manipulate two field value strings?

phpMyEdit General     How to manipulate two field value strings?
Odoslať novú tému   Odpovedať na tému    
 
devkbsc     Založený: 30.12.2014   Príspevky: 7  
Príspevok 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)
Príspevok 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  
Príspevok 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    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov