PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.database.mysql > Field to textfield
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Field to textfield

Réponse
 
LinkBack Outils de la discussion
Vieux 20/04/2006, 08h43   #1
wesley@ispace.co.za
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Field to textfield

Is there a way to take an entire row from a table and convert it to an
output string? I want to use the string and append it to a text file.

Thanks Wes

  Réponse avec citation
Vieux 20/04/2006, 11h44   #2
Aggro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Field to textfield

wesley@ispace.co.za wrote:
> Is there a way to take an entire row from a table and convert it to an
> output string? I want to use the string and append it to a text file.


You can use CONCAT() function to combine values from different columns.
The result will be a single string:

http://dev.mysql.com/doc/refman/5.0/...functions.html
  Réponse avec citation
Vieux 20/04/2006, 16h40   #3
onedbguru@firstdbasource.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Field to textfield

While the concat function is great, if you ever want to move this to a
real database engine like oracle... you can/should the ANSI standard
syntax.

select field1||','||field2||','||field3.... from tablex where ....

  Réponse avec citation
Vieux 20/04/2006, 18h56   #4
Bill Karwin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Field to textfield

onedbguru@firstdbasource.com wrote:
> While the concat function is great, if you ever want to move this to a
> real database engine like oracle... you can/should the ANSI standard
> syntax.
>
> select field1||','||field2||','||field3.... from tablex where ....


It should be mentioned that one has to set the SQL_MODE of
PIPES_AS_CONCAT or ANSI to enable this syntax.

Using this syntax without either of those SQL_MODE values in effect is
still a legal expression. The double-pipe works like logical OR when
not running in ANSI mode. So the resulting value of the expression will
be 1, which might be confusing.

Regards,
Bill K.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07676 seconds with 12 queries