SHARE
TWEET

Untitled

a guest May 22nd, 2017 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #----------------- mySQL Verbindung -----------------#
  2. $db_host = "localhost";
  3. $db_user = "humfred";
  4. $db_password = "";
  5. $db_name = "humfred_de_db";
  6.  
  7. $conn = mysql_connect($db_host,$db_user,$db_password) or die (mysql_error());
  8. mysql_select_db($db_name, $conn) or die (mysql_error());
  9.  
  10. $datum = date("d.m.Y"); # Das aktuelle Datum für den Eintrag wird hier erstellt
  11. $zeit = date("H:i");    # Die aktuelle Zeit für den Eintrag wird hier erstellt
  12. #----------------------------------------------------------#
  13.  
  14.  
  15. $sql = "SELECT * FROM gaestebuch ORDER BY id desc LIMIT 5";
  16. $result = mysql_query($sql);
  17. while($row = mysql_fetch_array($result))
  18. {
  19.   echo '<br/>';
  20.   echo '<u>Name:</u>   ';
  21.   echo($row['name']);
  22. }
  23.  
  24.  
  25. "INSERT INTO gaestebuch (id, Name, Mail, Text, date, time)
  26.      VALUES ('','$Name','$Mail','$Text','$datum', '$zeit')";
  27.  
  28.  
  29. $result = mysql_query("SELECT * FROM gaestebuch WHERE name LIKE '".$_REQUEST['suchen']."'");
  30.  
  31. if(mysql_num_rows($result) == 0){
  32. echo 'Fehler';
  33. }
  34.  
  35. else
  36. {
  37.  
  38.  
  39. while($row = mysql_fetch_array($result))
  40.  {                        
  41.    echo($row['name']);
  42.   }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top