Hi all,
I was able to upload the wav files into mysql database and iam able to retrieve the files but iam not able to play it in the php page.
its printing the some junk text. Iam not able to understand whether it is the problem with the content type or do i have to use files...
Iam posting my code below.
<html>
<head>
<title>The Rsvp List for Events</title>
<link rel="stylesheet" type="text/css" href="design.css" />
<style type="text/css">
</style>
</head>
<body>
/I have some html code here/
<?php
$link = mysql_connect('localhost', 'composit_cap', 'cap05');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('composit_capstone');
$result = mysql_query("SELECT owner_msgs FROM gp1_ownermsgs WHERE owner_phno='7814111234'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_row($result);
$wave_file = $row[0];
if (!$handle = fopen("rsvp_phno.wav", 'wb')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $wav_file) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($handle) to file ";
echo "<EMBED SRC=\"$handle\" HIDDEN=\"TRUE\" AUTOSTART=\"TRUE\"></EMBED>";
fclose($handle);
</body>
<html>