Hallo,
Also ich hab mir jetzt mal eine (bzw. 3) Datenbanken angelegt.
und jetzt habe ich so ein script:
<?php
$host = 'localhost';
$user = 'xxxxxx';
$pass = 'xxxxxx';
$db = 'test3';
/* Connecting, selecting database */
$link = mysql_connect($host, $user, $pass)
or die("Could not connect<br>");
print "Connected successfully<br>";
mysql_select_db($db)
or die("Could not select database<br>");
/* Performing SQL query */
$query = "SELECT * FROM my_table";
$result = mysql_query($query)
or die("Query failed<br>");
/* Printing results in HTML */
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>
da sehe ich zuerst ein textfeld und ein button.
was soll ich denn da überhaupt eingeben?
ich hab irgendwas eingegeben und dann gibt es folgednes aus:
Connected successfully
Could not select database
heisst: verbindung da, aber keine datenbank selektiert?!?
ich verstehe es irgendwie nicht ganz
MfG
Michael W.