 |
| Hinweise |
Willkommen im TP-Hilfe-Forum!Dies ist ein Forum zu den Themen Photoshop, Dreamweaver, Flash, Selbständigkeit und mehr, in dem Du Hilfe, Anleitung oder eine Lösung zu Deinen Problemen erhältst. Aktuell bist Du in unseren Foren als Gast mit reinen Leserechten unterwegs. Wenn Du Dich registrierst, kannst Du eigene Themen verfassen, Deine Frage stellen und privat mit anderen TPlern kommunizieren. Weitere Foren werden zugänglich, und Du wirst – falls gewünscht – per Mail über neue Beiträge informiert. Die Registrierung ist schnell und kostenlos. Sollten bei der Registrierung Fragen auftauchen, reicht ein Klick in unsere Hilfe - Häufig gestellte Fragen oder eine kurze Mitteilung an das Support-Team. Viel Spaß bei Traum-Projekt.com |
10.09.2003, 17:47
|
#1
|
|
TP-Senior
Registriert seit: May 2001
|
Daten aus einer Datenbank auslesen und bereitstellen
Liebes Forum,
ich bein MySQL-Newbie. Jetzt habe ich das Problem, dass Login Daten einer Software auch für ein Forum übernommen werden sollen. Ich hab mir das so gedacht, jemand meldet sich an und wenn er sich für das Forum registrieren möchte, werden alle wichtigen Daten eingelesen und und er brazucht nur noch "Registrieren" zu klicken...
Doch, wie lese ich die Daten aus der Bank aus und fülle Sie in Variablen???
Wäre über (schnelle - sorry! :-) Hilfe dankbar. Ich hab ja auch schon mal was vorbereitet, vielleicht hilft das schon:
Der Anmeldekrimskrams:
define("DB_HOST", "localhost");
define("DB_NAME", "datenbank");
define("DB_USER", "db_user");
define("DB_PWD", "db_pass");
und hier das anmelde und Speicherskript:
(sorry, ist sehr lang und unübersichtlich. Aber wenn ihr kurz mal drüberschauen könnt und mir sagt, wie ich an die Daten wieder rankomme)
Ich brauch zumindest $Name, $Passwort und $Email. Die anderen Daten dann später ;-)
Vielen Dank !!!!!!!!
<body bgcolor="#FFFFFF">
<p align="center"><b>
<?
$pass = is_logged($session_id);
if ($pass == "N") {
include("member_login.html");
} elseif($pass =="Y") {
?>
<?
$account_id = get_account_id($session_id);
$db = new ps_DB;
$q = "SELECT * FROM account WHERE account_id = '$account_id'";
$db->query($q);
$db->next_record();
$f_name = split(" ",$db->f("account_name"));
?>
Willkommen
<?
echo $f_name[0];
?>
! Sie befinden sich jetzt im Zugangsbereich. [ <a href="?page=account&next_page=account&session_id=<? echo $session_id ?>&action=logout">Abmelden</a> ]<br>
<?
$credits = credit_exsist($account_id);
if($credits > 0) {
echo "<BR>" . $f_name[0];
?>, you have an available account credit of <? echo setup("currency") . '' . number_format($credits,2); ?>.
<?
}
?>
</b></p>
<?
$dba = new ps_DB;
$q = "SELECT domain_host_id FROM domains WHERE
domain_account_id = '$account_id' AND
domain_host_status = '1'";
$dba->query($q);
if ($dba->num_rows() > 0) {
?>
<hr size="1" noshade>
<p><b></b>Sie können hier Ihre Adressdaten ändern.<br>
<br>
<b>
<? while ($dba->next_record()) {
$membership_id = $dba->f("domain_host_id");
$dbz = new ps_DB;
$q = "SELECT membership_name,membership_directory_id FROM membership WHERE membership_id = '$membership_id'";
$dbz->query($q);
$dbz->next_record();
$directory_id = $dbz->f("membership_directory_id");
if ($directory_id != 0)
{
$dbd = new ps_DB;
$q = "SELECT directory_url FROM directory WHERE directory_id = '$directory_id'";
$dbd->query($q);
$dbd->next_record();
$directory_url = $dbd->f("directory_url");
?>
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="field_t">
<tr>
<td width="51%"> <b>
<? $dbz->p("membership_name"); ?>
</b></td>
<td width="49%"><a href="<? echo $directory_url; ?>" target="_blank">Zum Plus Bereich</a></td>
</tr>
</table>
</b><b>
<? } } }
else
{?>
</b>
<p>Your account does not have any active subscriptions at this point. You will
need to <a href="?page=checkout_1&next_page=checkout_1&session_id=<? echo $session_id ?>"><b>complete
your order</b></a> first. <br>
<br>
If you have already placed an order, and it shows up below as pending, please
be patient. We are processing your order and will complete it as soon as possible.<br>
<?}?>
</p>
<b><form method="post" action="">
<hr size="1" noshade>
<? require("setup_reg_fields.php");?>
<br>
Your Account Information:
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="200" border="0" cellspacing="0" cellpadding="2" class="field_t">
<td width="81">
<div align="left">Username:</div>
</td>
<td width="111"><b>
<? $db->p("account_username"); ?>
</b></td>
</tr>
<? if ($f_display[name]) { ?>
<tr>
<td width="81">
<div align="left">Name:</div>
</td>
<td width="111"><b>
<input type="text" name="name" value="<? $db->p("account_name"); ?>" class="fields">
</b></td>
</tr>
<?
}
if ($f_display[company]) {
?>
<tr>
<td width="81">
<div align="left">Firma:</div>
</td>
<td width="111"><b>
<input type="text" name="company" value="<? $db->p("account_company"); ?>" class="fields">
</b></td>
</tr>
<?
}
if ($f_display[address]) {
?>
<tr>
<td width="81">
<div align="left">Straße:</div>
</td>
<td width="111"><b>
<input type="text" name="address" value="<? $db->p("account_address"); ?>" class="fields">
</b></td>
</tr>
<?
}
if ($f_display[city]) {
?>
<tr>
<td width="81">
<div align="left">Stadt:</div>
</td>
<td width="111"><b>
<input type="text" name="city" value="<? $db->p("account_city"); ?>" class="fields">
</b></td>
</tr>
<?
}
if ($f_display[state]) {
?>
<tr>
<td width="81">
<div align="left">State:</div>
</td>
<td width="111"><b>
<input type="text" name="state" value="<? $db->p("account_state"); ?>" class="fields">
</b></td>
</tr>
<?
}
if ($f_display[zip]) {
?>
<tr>
<td width="81">
<div align="left">Postleitzah:</div>
</td>
<td width="111"><b>
<input type="text" name="zip" value="<? $db->p("account_zip"); ?>" class="fields">
</b></td>
</tr>
<? } ?>
</table>
</td>
<td>
<table width="200" border="0" cellspacing="0" cellpadding="2" class="field_t">
<?
if ($f_display[phone]) {
?>
<tr>
<td width="69">
<div align="left">Telefon:</div>
</td>
<td width="129"><b>
<input type="text" name="acct_phone" value="<? $db->p("account_phone"); ?>" class="fields">
</b></td>
</tr>
<?
}
if ($f_display[fax]) {
?>
<tr>
<td width="69">
<div align="left">Fax:</div>
</td>
<td width="129"><b>
<input type="text" name="fax" value="<? $db->p("account_fax"); ?>" class="fields">
</b></td>
</tr>
<? } ?>
<tr>
<td width="69"> </td>
<td width="129"> </td>
</tr>
<tr>
<td width="69">
<div align="left">Email:</div>
</td>
<td width="129"><b>
<input type="text" name="email" value="<? $db->p("account_email"); ?>" class="fields">
</b></td>
</tr>
<tr>
<td width="69">
<div align="left">Passwort:</div>
</td>
<td width="129"><b>
<input type="password" name="password" value="<? $db->p("account_password"); ?>" class="fields">
</b></td>
</tr>
<tr>
<td width="69"> </td>
<td width="129"> </td>
</tr>
<tr>
<td width="69"> </td>
<td width="129">
<input type="submit" name="Submit" value="Daten aktualisieren" class="fields">
</td>
</tr>
</table>
<br>
<input type="hidden" name="page" value="account">
<input type="hidden" name="session_id" value="<? echo $session_id ?>">
<input type="hidden" name="action" value="update_member_account">
<input type="hidden" name="account_id" value="<? echo $account_id ?>">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<p>
<?
$dbs = new ps_DB;
$q = "SELECT id,name FROM newsletter WHERE active='Y' ORDER BY name ASC";
$dbs->query($q);
if($dbs->num_rows() > 0) {
?>
</p>
</b>
<hr size="1" noshade>
<b>
<form name="form1" method="post" action="">
<br>
Newsletter:
<table width="400" border="0" cellspacing="0" cellpadding="1" class="fields_back">
<tr>
<td>
<table width="400" border="0" cellspacing="0" cellpadding="2" class="fields_text">
<tr>
<td>
<input type="hidden" name="page" value="account">
<input type="hidden" name="account_id" value="<? echo $account_id ?>">
<input type="hidden" name="action" value="newsletter_sub">
<?while($dbs->next_record()) {?>
<input type="hidden" name="session_id" value="<? echo $session_id ?>">
<table width="100%" border="0" cellspacing="0" cellpadding="1" class="field_t">
<tr>
<td width="6%">
<input type="checkbox" name="n_id[<? echo $dbs->f("id") ?>]" value="Y" <? if(newsletter_acct_active($account_id,$dbs->f("id"))) echo "checked"; ?>>
</td>
<td width="94%">
<?$dbs->p("name");?>
</td>
</tr>
</table>
<? } ?>
<table width="400" border="0" cellspacing="0" cellpadding="0" class="fields_text">
<tr>
<td width="338">
<input type="submit" name="confirm33" value="Submit Changes" class="fields">
</td>
<td width="58"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<p>
<? }?>
</p>
</b> <b>
<?
$dbc = new ps_DB;
$q = "SELECT * FROM coupons WHERE account_id = '$account_id'";
$dbc->query($q);
while($dbc->next_record())
{
$coupon_code = $dbc->f("coupon_code");
$type = $dbc->f("type");
$rate = $dbc->f("rate");
if($type == 1)
{
$coupon_amount = setup("currency") . '' . number_format($rate,2);
}
else
{
$coupon_amount = number_format($rate*100) . '%';
}
if(validate_coupon($coupon_code))
{
$coupons[] = array (
'code' => $coupon_code,
'amount' => $coupon_amount
);
}
}
if(count($coupons) > 0) {
?>
</b>
<hr size="1" noshade>
<form name="form1" method="post" action="">
<b><br>
Available Coupons: </b>
<table width="400" border="0" cellspacing="0" cellpadding="1" class="fields_back">
<tr>
<td>
<table width="400" border="0" cellspacing="0" cellpadding="2" class="fields_text">
<tr>
<td> <b>
<input type="hidden" name="page" value="cart">
<input type="hidden" name="action" value="coupon_add">
</b>
<select name="coupon" class="fields">
<?
for($i=0; $i < count($coupons); $i++) {
?>
<option value="<? echo $coupons[$i][code] ?>"><? echo $coupons[$i][code] ?> ( <? echo $coupons[$i][amount] ?> )</option>
<? } ?>
</select>
<b>
<input type="submit" name=" " value="Use Coupon Now" class="fields">
</b> <b> </b> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<b>
<?}
?>
</b>
<hr size="1" noshade>
<b>
<?
if (check_cc_list($account_id)<>0) {
?>
<form name="form1" method="post" action="">
<br>
Your Credit Cards On File: <br>
<?
echo show_cc_list(get_account_id($session_id),"1");
?>
<input type="submit" name="Submit222" value="Edit ->" class="fields">
<input type="hidden" name="page" value="billing">
<input type="hidden" name="session_id" value="<? echo $session_id ?>">
</form>
<p>
<? }
if (setup("affiliate") == Y) { ?>
<br>
<br>
Your Affiliate Account:<br>
<? if (affiliate_exist($account_id) == Y) { ?>
<a href="?page=affiliates_admin&next_page=affiliates_admin&session_id=<? echo $session_id ?>">View
your affiliate area.</a><br>
<? } else { ?>
<a href="?page=affiliates_1&next_page=affiliates_1&session_id=<? echo $session_id ?>">You
do not have an affiliate account, click here to set one up now.</a><br>
<? }
}
}?>
</p>
</b>
</body>
</html>
|
|
|
11.09.2003, 10:16
|
#2
|
|
TP-Veteran
Registriert seit: Jun 2001
Ort: Wien
|
Hast Du dieses Script selbst geschrieben oder wo runtergeladen?? Wenn selbst geschrieben, dann solltest Du doch wissen wo Du die Daten hinspeicherst, oder??
Außerdem kann ich beim ersten überfliegen des Scripts nicht erkennen wo die Daten gespeichert werden (mir fehlt irgendwie ein INSERT für's SQL um Daten in die Tabelle zu speichern) !!
lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
|
|
|
11.09.2003, 10:58
|
#3
|
|
TP-Senior
Registriert seit: May 2001
|
Hallo, vielen Dank erst mal fürs drüberschauen!
Das Script ist natürlich NICHT von mir, aber ich muss es einsetzen... ;-(
Hilft das hier weiter?
// Check the old email and password against the new ones submitted to see if validation emails need to be sent....
$db = new ps_DB;
$q = "SELECT account_email,account_password FROM account WHERE account_id = '$account_id'";
$db->query($q);
$db->next_record();
$old_email = $db->f("account_email");
$old_password = $db->f("account_password");
//Compare old email...
if($f[email] != $old_email) {
// Send out an email authorization change...
$ret .= validate_email_change_1($f[email],$old_email,$old_password,$account_id);
}
//Compare old pass...
if($f[password] != $old_password) {
// Send out an password authorization change...
$ret .= validate_pass_change_1($f[password],$old_password,$old_email,$account_id);
}
// VALIDATE THE REQUIRED INFORMATION...
include($path . "setup_reg_fields.php");
// BUILD THE INSERT STATEMENT
$db = new ps_DB;
$q ="UPDATE account SET ";
// NAME
if ($f_required[name]) {
// Validate this field...
if (eregi("^[a-zA-Z.,]{2,} {1,}[a-zA-Z,. ?]{1,}[a-zA-Z.]{2,}$", $f[name])) {
if($comma) $q.= ' , ';
$q.=" account_name = '$f[name]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid name!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_name = '$f[name]' ";
$comma = TRUE;
}
// ADDRESS
if ($f_required[address]) {
// Validate this field...
if (eregi("^[a-zA-Z0-9.,]{1,} {1,}[a-zA-Z0-9,. ?]{1,}[a-zA-Z0-9.,]{2,}$", $f[address])) {
if($comma) $q.= ' , ';
$q.=" account_address = '$f[address]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid address!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_address = '$f[address]' ";
$comma = TRUE;
}
// CITY
if ($f_required[city]) {
// Validate this field...
if (strlen($f[city]) >= "2") {
if($comma) $q.= ' , ';
$q.=" account_city = '$f[city]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid city!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_city = '$f[city]' ";
$comma = TRUE;
}
//STATE
if ($f_required[state]) {
// Validate this field...
if (strlen($f[state]) >= "2") {
if($comma) $q.= ' , ';
$q.=" account_state = '$f[state]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid state!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_state = '$f[state]' ";
$comma = TRUE;
}
//ZIP
if ($f_required[zip]) {
// Validate this field...
if (strlen($f[zip]) >= "1") {
if($comma) $q.= ' , ';
$q.=" account_zip = '$f[zip]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid zip!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_zip = '$f[zip]' ";
$comma = TRUE;
}
// COMPANY
if ($f_required[company]) {
// Validate this field...
if (strlen($f[company]) >= "3") {
if($comma) $q.= ' , ';
$q.=" account_company = '$f[company]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid company!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_company = '$f[company]' ";
$comma = TRUE;
}
//PHONE
if ($f_required[phone]) {
// Validate this field...
if (strlen($f[acct_phone]) >= "10") {
if($comma) $q.= ' , ';
$q.=" account_phone = '$f[acct_phone]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid phone!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_phone = '$f[acct_phone]' ";
$comma = TRUE;
}
// FAX
if ($f_required[fax]) {
// Validate this field...
if (strlen($f[fax]) >= "10") {
if($comma) $q.= ' , ';
$q.=" account_fax = '$f[fax]' ";
$comma = TRUE;
} else {
$ret.="<BR>Please enter a valid fax!";
}
} else {
if($comma) $q.= ' , ';
$q.=" account_fax = '$f[fax]' ";
$comma = TRUE;
}
$q.="WHERE account_id= '$account_id'";
$db->query($q);
|
|
|
11.09.2003, 11:08
|
#4
|
|
TP-Veteran
Registriert seit: Jun 2001
Ort: Wien
|
Wo hast Du denn das Script her??
Hast Du zugang zu der Datenbank ??
lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
|
|
|
11.09.2003, 11:25
|
#5
|
|
TP-Senior
Registriert seit: May 2001
|
www.dreamcost.com, heisst dreamaccount, kost aber geld.
Ja, hab Zugang zur DB, aber nicht als root. Das (Dreamaccount und Forum) sind auch getrennte Datenbanjken, aber das ist ja nicht schlimm?
|
|
|
11.09.2003, 11:34
|
#6
|
|
TP-Veteran
Registriert seit: Jun 2001
Ort: Wien
|
Schau mal in die Datenbank da wird es wahrscheinlich irgendeine Tabelle geben die "user", "account" oder ähnlich heißt da würde ich die benötigten Daten vermuten.
Oder Du schaust Dir die .php-Datei an wo die Klasse für die Datenbank-Aktionen drinn sind an und schaust wo das INSERT für die Userdaten hingeht!
Schreibst Du den das Forum selbst?
lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
|
|
|
11.09.2003, 11:38
|
#7
|
|
TP-Senior
Registriert seit: May 2001
|
super das du grad online bist ;-)
Also, ich hab grad (zum ersten Mal, also keine zu schwierigen Fragen bitte!  phpMyAdmin installiert. und da ist auch eine Tabelle "account".
Und die hat Unterfelder, zb.: account_password, account_email, account_name, account_username ...
ich bin mir fast sicher, dass ich die gebrauchen könnte. Nur, wie les ich die jetzt aus, am besten gleich in php-Variablen, die bastel ich dann irgenwie in das Forum rein...
Schon mal vielen Dank!
|
|
|
11.09.2003, 11:55
|
#8
|
|
TP-Veteran
Registriert seit: Jun 2001
Ort: Wien
|
Arbeitest Du zum ersten mal mit PHP in verbindung mit Datenbanken??
lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
|
|
|
11.09.2003, 12:00
|
#9
|
|
TP-Senior
Registriert seit: May 2001
|
hmmm, ja, gezwungener maßen. Ich muss heute noch diese blöde kombination zusammenbauen, sonst schaffen wir den Relaunch nicht und am Montag wird der Server abgeschaltet...
Ich schrieb doch zu Beginn, ich bin da ein Newbie ;-)
|
|
|
11.09.2003, 12:03
|
#10
|
|
TP-Senior
Registriert seit: May 2001
|
Aaaaach, wenn ich die Daten aus dieser Datenbank herausbekomme, woher weiss ich eigentlich, wie der Typ heisst? Ich muss ja irgendwie if($datenbank_geholt_name == $aktueller_name) { zeige_details; } machen. Leider loggt er sich ein und der Verzeichnis-Schutz geht über die .htaccess.
Weiss gar nicht, ob die Benutzerdaten im Cookie oder so gespeichert werden...
so, ich hab das gecheckt, das einzige was gespeichert wird (als cookie) ist sessionid, sessionhash und lastvisit. Daraus kann ich schlecht Userinfos ableiten, oder? Und eigene Cookies wollte ich eigentlich gerade nicht setzen...
Geändert von nicor (11.09.2003 um 12:18 Uhr).
|
|
|
11.09.2003, 12:25
|
#11
|
|
TP-Veteran
Registriert seit: Jun 2001
Ort: Wien
|
Das ist das erste Problem, das kann man aber so lösen das wenn sich der Typ am ersten System anmeldet automatisch die Daten in die Tabelle fürs Forum mitgespeichert werden. Das zweite Problem ist das, wenn Du das Forum nicht selbst programmierst und Ihr euch ein frei erhältliches Forum holt (wie z.B. phpBB) dann müssen dort auch wieder verschiedene Daten in verschiedene Tabellen gespeichert werden. Ich glaub die einfachste Methode ist das sich der User halt im Forum extra registrieren muss.
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
|
|
|
11.09.2003, 12:32
|
#12
|
|
TP-Senior
Registriert seit: May 2001
|
ja, hast recht. das Forum wird yabb werden. Ich wollte das so lösen, dass alle User Eingaben, die fürs Forum gemacht werden müssen, nicht merh editierbar sind, und die Werte aus der anderen Datenbank bekommen. Wenn ich die mal hätte. Ausserdem soll der User immer mit Namen begrüsst werden (können)...
nico
|
|
|
11.09.2003, 12:49
|
#13
|
|
TP-Senior
Registriert seit: May 2001
|
ich hab ein wenig probiert,
was sagst du denn zu diesme Code:
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);
$q = "SELECT account_name,account_password,account_email FROM account WHERE account_name='$name'";
$settings = mysql_fetch_row($q);
echo $setting[0]."<br>";
echo $setting[1]."<br>";
echo $setting[2]."<br>";
echo $setting[3]."<br>";
echo $setting[4]."<br>";
Die Zugangsdaten hab ich vorher auch definiert, aber es kommt keine Ausgabe... ;-(
|
|
|
11.09.2003, 12:58
|
#14
|
|
TP-Veteran
Registriert seit: Jun 2001
Ort: Wien
|
Da fehlt was!! Du must den SQL-Befehl auch an die DB senden!
Versuchs mal so:
PHP-Code:
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);
$q = "SELECT account_name,account_password,account_email FROM account WHERE account_name='$name'";
$result = mysql_query($q, $dbcon) or die ("Abfrage kann nicht gesendet werden");
while ($row = mysql_fetch_array($result))
{
echo $row[0]."<br>\n";
echo $row[1]."<br>\n";
echo $row[2]."<br>\n";
...
}
lg
Flow
__________________
Lesser known Programming Languages #13: SLOBOL
... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.
|
|
|
11.09.2003, 13:12
|
#15
|
|
TP-Senior
Registriert seit: May 2001
|
Super!!! Mein erster Datenbank Zugriff. Naja, noch nicht allein, aber ich bin totzdem stolz ;-)
Also, das geht. Vielen Dank erstmal!
Wenn ich vorher $name definiert hab, macht diese Anweisung hier: "WHERE account_name='$name'" dass er nur diesen Namen ausliest?
Das wär ja genau was ich brauchte...
|
|
|
|
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
|
|
|
| Themen-Optionen |
Thema durchsuchen |
|
|
|
| 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.
HTML-Code ist aus. | | | |