<?php //get artist/title info $artist = $_GET['artist']; $title = $_GET['title']; //create a temp file to store values for AJAX script $r = fopen("temp_title.txt", "w"); fwrite($r, $artist." - ".$title); fclose($r); ?>
ссылка
CREATE TABLE IF NOT EXISTS `songs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `Title` text CHARACTER SET utf8 NOT NULL, `time` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM
<?php require('./adodb5/adodb.inc.php'); if (!empty($_GET["song"])) { $db=NewADOConnection('mysql'); $db->Connect('localhost','user1','password1','PESNI'); $db->debug=false; $record['Title']=$_GET["song"]; $record['time']=date("Y-m-d H:i:s"); $insertSQL = $db->AutoExecute('songs', $record, 'INSERT'); $db->close(); echo "Received"; } else { echo "ERROR"; } ?>
<?php require('./adodb5/adodb.inc.php'); $db=NewADOConnection('mysql'); $db->Connect('localhost','user1','password1','PESNI'); $db->debug=false; $list=$db->GetAll("SELECT title FROM songs ORDER BY id DESC LIMIT 10"); foreach($list as $msg) { print $msg['title']; } $db->close(); ?>