WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 10.01.2006, 18:06   #1
alexA320
Veteran
 
Registriert seit: 25.03.2005
Alter: 34
Beiträge: 429


PHP <--> MySQL Problem

Hallo!

Bin ziemlicher Anfänger in sachen MySQL und stehe vor folgendem, eigendlich eher simplen Problem:

<?php mysql_connect(yxz,zxy,xyz);
mysql_select_db ( database ) ;
$result= mysql_query ("SELECT question FROM questions LIMIT 1") ;
$row = mysql_fetch_array ($result) ;
print $row ;

?>

Ich will, dass er aus der DB eine Frage herrausnimmt und darstellt. Mit obigen script funzt das nicht als Antwort schreibt er nur: array .

Sorry euch mit so einfachen Problemen zu nerven, trotzdem schon mal Danke im Vorraus!


Alex
____________________________________
<--Gruß Alex-->

Cargo motzt nicht, Cargo kotzt nicht!

http://status.ivao.aero/147360.png

alexA320 ist offline   Mit Zitat antworten
Alt 10.01.2006, 18:29   #2
jak
Inventar
 
Registriert seit: 13.06.2001
Beiträge: 1.830


Standard

Du verwechselst print und print_r.

jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
jak ist offline   Mit Zitat antworten
Alt 10.01.2006, 18:41   #3
m@rio
Master
 
Registriert seit: 10.10.2002
Beiträge: 711


Standard

Ein Array besteht aus beliebigen Anzahl von Feldern. In deinem Fall aus genau einem. Die Felder werden von 0 an durchnumeriert.

print $row[0];
gibt dir daher das erste Feld des Arrays aus.
m@rio ist offline   Mit Zitat antworten
Alt 10.01.2006, 18:50   #4
alexA320
Veteran
 
Registriert seit: 25.03.2005
Alter: 34
Beiträge: 429


Standard

Danke, hab das Problem gelöst.
____________________________________
<--Gruß Alex-->

Cargo motzt nicht, Cargo kotzt nicht!

http://status.ivao.aero/147360.png

alexA320 ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

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

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 21:11 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag