Posted By

antpaw on 08/20/08


Tagged

mysql php connection


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

novatvstdios
vali29
bitlimakina
ottoman153


MySQL connection with PHP


 / Published in: PHP
 

  1. <?php
  2. mysql_connect("localhost","root","asdf") or die (mysql_error());
  3.  
  4. $result = mysql_query('SELECT * FROM tabellename') or die (mysql_error());
  5.  
  6. while($entry = mysql_fetch_assoc($result)){
  7. $entry['headline']
  8. }
  9.  
  10.  
  11.  
  12.  
  13. $entry= "INSERT INTO tabellename (feld1, feld2) VALUES ('111111s', '2222222s');";
  14. $init = mysql_query($entry);
  15.  
  16. $change = "UPDATE blog Set tag = 'Cinema 4D' WHERE id = '2'";
  17. $update = mysql_query($change);
  18. ?>

Report this snippet  

You need to login to post a comment.