Get data

Frequently asked questions with answers

Get data

Postby Kid2 » Sat Jul 28, 2007 8:12 pm

hi... :D
I was wondering if there is somone that can tell me how i can get some data from the kplaylist sql?
I'am trying to get info from the playlist, but whit no luck.... :(

so if there are somone that can make an script, or maby try to help me on the way, i will be graitful :D
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby tcghost » Sun Jul 29, 2007 5:11 am

perhaps posting what data you're trying to get would be helpful.
tcghost
 
Posts: 229
Joined: Fri Nov 04, 2005 6:48 pm
Location: Florida

Postby Kid2 » Sun Jul 29, 2007 10:05 am

that i try to get out is the playlist that have been made in kplaylist.
ex: if have an playlist, and the u_id in sql is 10.( thats the playlist id).
How can i get it out from the sql?
Just like this:
seq, artist, song, streamurl....

can you help?
Last edited by Kid2 on Mon Jul 30, 2007 12:33 am, edited 2 times in total.
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby tcghost » Sun Jul 29, 2007 10:39 pm

you can use the following query:
Code: Select all
SELECT tbl_search.id, tbl_search.artist, tbl_search.title FROM tbl_playlist LEFT JOIN tbl_playlist_list ON tbl_playlist.u_id = tbl_playlist_list.listid LEFT JOIN tbl_search ON tbl_playlist_list.sid = tbl_search.id WHERE tbl_playlist.u_id = 1;
tcghost
 
Posts: 229
Joined: Fri Nov 04, 2005 6:48 pm
Location: Florida

Postby Kid2 » Sun Jul 29, 2007 11:20 pm

okey...and how do i go next?
I have now tryed to get it shown now, but no good so fare :?

i get it out like this now:
Connected successfully
4495 U2 Love And Peace Or Else
the 4495 is the track id?
The playlist are sorted by "seq" ?

If U2 is the track number 3 in the playlist, then i will have it
shown like this:
1. Banana - Crazy bannana
2. Gwen S - Hello
3. U2 - war

Wanna have it shown just like when u are edit the playlist...

but whitout the edit stuff.. Understand? :)
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby tcghost » Mon Jul 30, 2007 6:09 am

just add a SORT BY tbl_playlist_list.seq to the query
Code: Select all
SELECT tbl_search.id, tbl_search.artist, tbl_search.title FROM tbl_playlist LEFT JOIN tbl_playlist_list ON tbl_playlist.u_id = tbl_playlist_list.listid LEFT JOIN tbl_search ON tbl_playlist_list.sid = tbl_search.id WHERE tbl_playlist.u_id = 1 SORT BY tbl_playlist_list.seq;
tcghost
 
Posts: 229
Joined: Fri Nov 04, 2005 6:48 pm
Location: Florida

Postby Kid2 » Mon Jul 30, 2007 10:33 am

Get an error whit the use of this
Somthing is wrong
here is the message:

Connected successfully
Query failed: Something is wrong in your syntax nær ' SORT BY tbl_playlist_list.seq' på linje 1

Here is my code:
// Performing SQL query

$query = 'SELECT tbl_search.id, tbl_search.artist, tbl_search.title FROM tbl_playlist LEFT JOIN tbl_playlist_list ON tbl_playlist.u_id = tbl_playlist_list.listid LEFT JOIN tbl_search ON tbl_playlist_list.sid = tbl_search.id WHERE tbl_playlist.u_id = 10';
$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);
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby tcghost » Mon Jul 30, 2007 1:40 pm

sorry about that, it was late last night... it's ORDER not SORT
Code: Select all
SELECT tbl_search.id, tbl_search.artist, tbl_search.title FROM tbl_playlist LEFT JOIN tbl_playlist_list ON tbl_playlist.u_id = tbl_playlist_list.listid LEFT JOIN tbl_search ON tbl_playlist_list.sid = tbl_search.id WHERE tbl_playlist.u_id = 1 ORDER BY tbl_playlist_list.seq;
tcghost
 
Posts: 229
Joined: Fri Nov 04, 2005 6:48 pm
Location: Florida

Postby Kid2 » Mon Jul 30, 2007 2:15 pm

i still get the same....its no different...
Connected successfully
2281
10477 Dr Alban U & Mi
2295 Dr Alban It`s My Life


--------------------------------------------------------
seq name Track

Btw....how do i get the url to the songs?

is it possible to use the editor in kplaylist to save the playlist to another db? and use the other db to get info from?
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby tcghost » Mon Jul 30, 2007 2:45 pm

That should be the order that the playlist is in in kplaylist.

To get the url just use http://www.kplaylist.net/demo/index.php?sid={id}
tcghost
 
Posts: 229
Joined: Fri Nov 04, 2005 6:48 pm
Location: Florida

Postby Kid2 » Mon Jul 30, 2007 3:57 pm

XbumpX
Last edited by Kid2 on Sun Dec 02, 2007 7:01 pm, edited 2 times in total.
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby Kid2 » Mon Jul 30, 2007 6:42 pm

how do i get the playlist editor from kplaylist?
just as an singel file/script whit all of the function?

Can somone make that?

btw tcghost:

the sql query dint show it like am trying to...
do u know how to fix it?
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am

Postby Kid2 » Wed Aug 01, 2007 5:30 pm

okey...no answer...then we must go futher whit this then...

So..how do i get the playlist shown just like it's shown in the editor?

tcghost has somthing ther, but still something must be changed if am gone get it shown right.... :)
Kid2
 
Posts: 32
Joined: Sat Aug 19, 2006 11:07 am


Return to FAQ



cron