php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 24.08.2004, 17:20  
Gast
 
Beiträge: n/a
Standard Problem mit Ausgabe

Habe noch ein Problem. Finde den Fehler im Skript einfach nicht.
$Price->printTicketType zeigt einfach nichts an.

Hier das Skript:
Code:
<?php

require_once "price.class.php";

$Price = new Price();

?>
<html>
<head>
</head>
<body>

<h2>Wählen Sie bitte aus einem der Bereiche aus!</h2>

<form name="form" action="<?=$_SERVER['PHP_SELF']; ?>" method="post">



<table><tr><td>

<?
echo $Price->printDuration();
?>

</td><td>

<?

$Price->printTicketType();
?>

</td></tr></table>

<?
if ($group[1]){
	echo'1';}
	

elseif ($group[2]){
	echo '2';}
?>

</p>
</form>

</body>
</html>
Hier die Klasse:
Code:
<?php

require_once "config5.php";

class Price{
	
	// Konstruktor
	function Price(){
	}

	// Ticketart
	function getTicketDuration(){
		
		$query = "SELECT id, ticket_duration FROM ticket_category WHERE ticket_group_id =1";
				
		return mysql_query($query);
		
		}
	
	
	function printDuration(){

		$result = $this->getTicketDuration();
		
		$selectDuration = '<select name="duration[]" size="1"><option>Bitte auswählen</option>';
			
		while($row = mysql_fetch_array($result)){
			
			$selectDuration .=  '<option value='.$row['id'].'>'.$row['ticket_duration'].'</option>';
	
		 }
		 
		 $selectDuration .= '</select>';
		 
		 return $selectDuration;
	}
	
	//Tickettyp
	function getTicketType(){
		
		$query = "SELECT  ticket_class, ticket_name, ticket_description FROM ticket_types ";
				
		return mysql_query($query);
		
		}
	
	
	function printTicketType(){

		$result = $this->getTicketType();
		
		
			
		while($row = mysql_fetch_array($result)){
			
			 echo '<table><tr><td>'.$row['ticket_class'].'</td></tr><tr><td>'.
							$row['ticket_name'].'</td></tr><tr><td>'
							.$row['ticket_description'].'</td></tr></table>';
			
	
		 }
		 
	}

}


?>
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 24.08.2004, 17:46  
Gast
 
Beiträge: n/a
Standard

wo ist in der function printTicketType() das retrurn ???

kommt doch nix zurück
 
Alt 24.08.2004, 17:59  
Gast
 
Beiträge: n/a
Standard

Wenn ich es z.B. so mache, dann bekomme ich eine select box angezeigt. Die möchte ich aber nicht, sondern nur eine Tabelle.
Code:
function printTicketType(){

		$result = $this->getTicketType();
		
		
			
		while($row = mysql_fetch_array($result)){
			
			 $selectType= '<table><tr><td>'.$row['ticket_class'].'</td></tr><tr><td>'.
							$row['ticket_name'].'</td></tr><tr><td>'
							.$row['ticket_description'].'</td></tr></table>';
			
		 }
		 return $selectType;
	}
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] problem keine ausgabe coraplanet PHP Tipps 2008 12 02.05.2008 18:51
Class Ausgabe Problem wk-moray PHP-Fortgeschrittene 6 12.02.2008 10:06
problem mit ausgabe von daten phyton Datenbanken 3 02.07.2007 17:44
Problem mit der Ausgabe Kein Genie PHP Tipps 2006 5 26.11.2006 21:24
Problem mit einer Ausgabe mit for... PHP Tipps 2005-2 4 30.09.2005 19:26
3 Tabellen verbunden -- Ausgabe in einer Spalte Datenbanken 4 06.09.2005 10:43
Problem mit der Ausgabe PHP Tipps 2005-2 2 29.07.2005 18:09
problem bei ausgabe einer abfrage aus 2 Tabellen Lia PHP Tipps 2005-2 2 28.07.2005 17:30
Problem mit PFad Firefox - Verzeichnis löschen PHP Tipps 2005-2 0 19.07.2005 16:05
Problem mit Ausgabe in Optionfelder (<select>) Monty77 PHP Tipps 2005 4 27.01.2005 22:33
[Erledigt] Problem mit Text Ausgabe in neuem Fenster PHP Tipps 2005 6 18.01.2005 14:24
variablen ausgabe problem..... PHP Tipps 2005 3 06.01.2005 02:27
Problem mit Ausgabe picco PHP Tipps 2004-2 2 24.12.2004 15:38
problem mit ausgabe bei einer "tmp"-table... nautiluS PHP Tipps 2004-2 0 20.12.2004 15:12
Problem mit Array und Ausgabe picco PHP Tipps 2004-2 3 16.12.2004 23:03


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:36 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.