Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user = "mysqlusername";
- $pass = "fbyqZzyh6FxCtNau";
- $db = "db_name";
- $con = mysql_connect("localhost",$user,$pass) or die ("Verbindungsproblem.");
- mysql_select_db($db,$con);
- $query = "select title,text from articles where 1=1;";
- $result = mysql_query($query);
- if($result) {
- echo "<table border=1>";
- while($row=mysql_fetch_row($result))
- {
- for($i=0;$i<count($row);$i++){
- echo "<tr>\n";
- echo "<td>";
- if($i==0)
- echo "<h3>";
- echo $row[$i];
- if($i==0)
- echo "</h3>";
- echo "</td>\n";
- echo "</tr>\n";
- }
- }
- echo "</table><br><br>";
- } else {
- echo "<br>".mysql_errno($con) . ": " . mysql_error($con) . "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement