Return to Snippet

Revision: 7915
at August 20, 2008 16:23 by antpaw


Updated Code
<?php
mysql_connect("localhost","root","asdf") or die (mysql_error());
mysql_select_db("DB") or die (mysql_error());

$result = mysql_query('SELECT * FROM tabellename') or die (mysql_error());

while($entry = mysql_fetch_assoc($result)){
$entry['headline']
}

mysql_free_result($result);



$entry= "INSERT INTO tabellename (feld1, feld2) VALUES ('111111s', '2222222s');";
$init = mysql_query($entry);

$change = "UPDATE blog Set tag = 'Cinema 4D' WHERE id = '2'";
$update = mysql_query($change);
?>

Revision: 7914
at August 20, 2008 16:14 by antpaw


Initial Code
<?php
mysql_connect("localhost","root","asdf") or die (mysql_error());
mysql_select_db("DB") or die (mysql_error());

$result = mysql_query('SELECT * FROM tabellename') or die (mysql_error());

while($entry = mysql_fetch_assoc($result)){
$entry['headline']
}

mysql_free_result($ergebnis);



$eintrag = "INSERT INTO tabellename (feld1, feld2) VALUES ('111111s', '2222222s');";
$eintragen = mysql_query($eintrag);

$aendern = "UPDATE blogz0r Set tag = 'Cinema 4D' WHERE id = '2'";
$update = mysql_query($aendern);
?>

Initial URL

                                

Initial Description

                                

Initial Title
MySQL connection with PHP

Initial Tags
mysql, php

Initial Language
PHP