Bonjour
J'ai un petit soucis, j'aurais besoin d'aide svp.
(Je suis débutant en php).
J'ai une base mysql "yahd" avec une table ticket dans ma base.
champs de ma table:
ticketID (int, en auto increment), applicationName, login, priority, type, creationDate, Onliner, detailDescription, attachmentName
Je recupere des données via un formulaire html que je souhaite integrer
les données réccupérées me serve a créer une instance de ma class TIcket, constructeur:
function __construct($applicationName, $login, $priority, $type, $creationDate, $oneLiner, $detailedDescription, $attachmentName = '', $ticketID = -1)
Je n'arrive pas a ecrire ma fonction save (t$ticket) qui doit faire un insert sur ma table (SANS UTILISER DE PDO).Cette methode fait partie de la class MySQLTicketDAO.class.php dont le début est:
include_once 'mysql.conf.php';
@mysql_pconnect($GLOBALS['g_Host'], $GLOBALS['g_User'], $GLOBALS['g_Password']) or die ("Connection impossible");
@mysql_select_db($GLOBALS['g_DbName']);
if ( mysql_errno() != 0 ) echo "Error : " . mysql_error();
include_once 'Ticket.class.php';
include_once 'TicketDAO.class.php';
class MySQLTicketDAO extends TicketDAO {
private $TABLE_NAME = 'ticket';
private $COLUMN_NAMES = ' ticketID , applicationName , login , priority , type , creationDate , oneLiner , detailedDescription , attachmentName ';
public function save ($ticket){
$query="INSERT INTO $this->TABLE_NAME (ticketID, applicationName, login, priority, type, creationDate, oneLiner, detailedDescription, attachmentName)
VALUES ('',
'$this->applicationName()',
'$ticket->getLogin()',
'$ticket->getPriority()',
'$ticket->getType()',
'$ticket->getCreationDate(),'
'$ticket->getOneLiner()',
'$ticket->getDetailedDescription()',
'$ticket->getAttachmentName())";
$request = mysql_query($query);
echo 'ticket est bien sauvegardé!';
}
....
voici les message d'erreur qu'il me renvoie:Notice: Undefined property: MySQLTicketDAO::$applicationName in C:\wamp\www\tpdsi\tp5\MySQLTicketDAO.class.php on line 43......
Notice: Undefined property: Ticket::$getLogin in C:\wamp\www\tpdsi\tp5\MySQLTicketDAO.class.php on line 44..
Notice: Undefined property: Ticket::$getPriority in C:\wamp\www\tpdsi\tp5\MySQLTicketDAO.class.php on line 45...
Notice: Undefined property: Ticket::$getType in C:\wamp\www\tpdsi\tp5\MySQLTicketDAO.class.php on line 46...
Notice: Undefined property: Ticket::$getCreationDate in C:\wamp\www\tpdsi\tp5\MySQLTicketDAO.class.php on line 47...
idem pour: Ticket::$getOneLiner, Ticket::$getDetailedDescription, property: Ticket::$getAttachmentName,