943,994 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2561
  • PHP RSS
Mar 27th, 2006
0

Online library

Expand Post »
Im building an online music video library with php can anyone point me out getting it wrking with the database
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Brims is offline Offline
44 posts
since Nov 2005
Mar 27th, 2006
0

Re: Online library

I'm a nice guy, but I got to say, RTFM. The code examples in the PHP documentation are VERY good. It is unlikely that anyone here is going to explain it more simply than the PHP documentation.

You did not mention what database you want to use, but lets assume MySQL. Here is a link to PHP's MySQL-related functions.
http://www.php.net/manual/en/ref.mysql.php

From the link above:
[PHP] <?php
// Connecting, selecting database
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');

// Performing SQL query
$query = 'SELECT * FROM my_table';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());

// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";

// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);
?> [/PHP]
Reputation Points: 36
Solved Threads: 6
Posting Whiz
Troy is offline Offline
354 posts
since Jun 2005
Mar 27th, 2006
0

Re: Online library

The database is my sql i have connected to the database

itsuite.it.bton.ac.uk/student/iak/m

with the join form

i want to have a database with music link it to an API or something so that the database will have music on it so it can be streamed to a browser or mobile phone and pda devices
Reputation Points: 10
Solved Threads: 0
Light Poster
Brims is offline Offline
44 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Make my own IM program and MySpace Clone.
Next Thread in PHP Forum Timeline: PHP 5 - Over before it began





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC