Page 1 sur 1

Formulaire

Posté : 14 mars 2013, 13:26
par zeroro11
Je n'arrive pas à connecter la BDD à la catégorie $sexe
Comment faire ?
<?php
$q = !empty( $acc->question ) ? $acc->question : 'DELETE';
$r = !empty( $acc->reponse ) ? $acc->reponse : 'DELETE?';
$sexe = !empty( $acc->sexe ) ? $acc->sexe : 'Sexe?';
$email = !empty( $acc->email ) ? $acc->email : 'Mettez votre e-mail';
$newl = tag( 'br' );
$champs = array(
		array( 'pass', lang( 'acc.register.password' ) . $newl, NULL, $acc->pass ),
		array( 'pseudo', $newl . lang( 'pseudo' ) . $newl, NULL, $acc->pseudo ),
		array( 'email', $newl . lang( 'acc.register.mail' ) . $newl, NULL, $email ),
		array( 'question', $newl . lang( 'acc.register.question' ) . $newl, NULL, $q ),
		array( 'reponse', $newl . lang( 'acc.register.answer' ) . $newl, NULL, $r ),
		array( 'sexe', $newl . lang ( 'sexe' ) . $newl, NULL, $sexe ),
		array( 'guid', NULL, 'hidden', $acc->guid ),
       );

if( level( LEVEL_ADMIN ) )
{
	$champs = array_merge( $champs, array(
			array( 'banned', $newl . lang( 'acc.register.banned' ) . $newl, 'checkbox', intval( $acc->banned ) ),
			array( 'level', $newl . lang( 'level' ) . $newl, 'select', Member::getLevels(), $acc->level ),
	) );
}
if( NEW_RECORD || level( LEVEL_ADMIN ) )
{
	$champs = array_merge( array(
			array( 'account', $newl . lang( 'account' ) . $newl, NULL, $acc->account ),
		), $champs );
}

echo make_form( NEW_RECORD ? array_merge( array( array( 'tos', lang( 'acc.register.accept_tos' ), 'checkbox' ) ), $champs ) : $champs, APPEND_FORM_TAG );

if( level( LEVEL_ADMIN ) && $acc->Personnages->count() )
{
	echo tag( 'h1', ucfirst( pluralize( lang( 'character'), $acc->Personnages->count() ) ) )
	 . tag( 'br' );

	$persos = '';
	foreach( $acc->Personnages as $perso )
	{
		$persos .= tag( 'td', tag( 'b', lang( 'name' ) . ': ' ) . $perso->name
		 . tag( 'br' ) . tag( 'b', lang( 'acc.ladder.class' ) . ': ' ) . IG::getClass( $perso->class )
		 . tag( 'br' ) . tag( 'b', lang( 'acc.ladder.sex' ) . ': ' ) . IG::getSexe( $perso->sexe ) );
	}
}

Re: Formulaire

Posté : 14 mars 2013, 15:19
par damien_55
1-Tu as ouvert ta connexion parce je vois rien qui y ressemble dans ton code ?
2- c'est quoi ? c'est un peu vague ta question, ton morceau de code sert à quoi ? formulaire, requete ???

En gros, ça sort d'ou ? ça ressemble à un copier-coller de code mais il en manque.

Un peu plus d'infos stp.