Results 1 to 10 of 10
-
22nd Aug 2011, 05:35 PM #1OPMemberWebsite's:
porndex.eu massprchecker.comMysql fetch specific data from row (id)
Ok so im not very good with all this mysql stuff but im having a go.
I have built a script that inserts into my DB the following:
Video Link (playable mp4,avi etc etc)
Video Title
Video download link
I now have my output done BUT im using the echo command to pull the media link from my DB into the media player
Example:
Code:<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"> <PARAM NAME="FileName" VALUE="<?php echo("$vid_source"); ?>"> <PARAM name="autostart" VALUE="false"> <PARAM name="ShowControls" VALUE="true"> <param name="ShowStatusBar" value="false"> <PARAM name="ShowDisplay" VALUE="false"> <EMBED TYPE="application/x-mplayer2" SRC="<?php echo("$vid_source"); ?>" NAME="MediaPlayer" WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED> </OBJECT>
Now this works fine and plays the video BUT all the movie players play the same video so i need to use something like
Code:<?php echo("$vid_source from $id1"); ?>
Thanks
RRroadrunner Reviewed by roadrunner on . Mysql fetch specific data from row (id) Ok so im not very good with all this mysql stuff but im having a go. I have built a script that inserts into my DB the following: Video Link (playable mp4,avi etc etc) Video Title Video download link I now have my output done BUT im using the echo command to pull the media link from my DB into the media player Rating: 5
-
22nd Aug 2011, 05:56 PM #2Member
first of all you have to get the id of the video using $_GET from the user.
You can do something like this:
$id = $_GET['videoid'];
$sql = "SELECT * FROM table WHERE id={$id}";
$query = mysql_query($sql);
while($result = mysql_fetch_array($query)){
echo $result['id'] . $result['videolink'] . $result['videotitle']
}
-
22nd Aug 2011, 05:56 PM #3Respected MemberWebsite's:
DL4Everything.com Soft2050.inGive an example link to your website
Get the data by input get in a variable
Then connect to the mysql database and use "MySQL Select" to select the row and then fetch the variable from that row
About MYSQL Select:
http://dev.mysql.com/doc/refman/5.0/en/select.html
http://www.w3schools.com/PHP/php_mysql_select.asp
-
22nd Aug 2011, 06:09 PM #4OPMemberWebsite's:
porndex.eu massprchecker.comThanks for the quick response.
Take a look here ( ignore the cosmetic side at the moment please):
http://userporn.co.uk/new_site/out2.php
You will see from the text output there are 2 diferent MP4 links
But the media players only play the last one....
Here is my DB :
So i need to make this :
Code:<?php echo("$vid_source"); ?>
Cheers
RR
-
22nd Aug 2011, 07:00 PM #5Respected Member
Try this:
PHP Code:<?PHP
$user_name = "DbUserName";
$password = "DbPassword";
$database = "DbName";
$server = "localhost";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "SELECT vid_source FROM DbTableName";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
echo $db_field['vid_source']."<br>";
}
mysql_close($db_handle);
}
else {
echo "Database NOT Found ";
mysql_close($db_handle);
}
?>
-
22nd Aug 2011, 07:12 PM #6OPMemberWebsite's:
porndex.eu massprchecker.com
-
22nd Aug 2011, 07:13 PM #7OPMemberWebsite's:
porndex.eu massprchecker.com
-
22nd Aug 2011, 10:27 PM #8Member
ofc it is possible, when you use mysql_fetch_array(); those info are placed inside the array, e.g.
array['vid_source']
-
23rd Aug 2011, 01:51 AM #9OPMemberWebsite's:
porndex.eu massprchecker.comThanks all
Have now got it sorted as you will see here:
http://userporn.co.uk/new_site/
Cheers
RR
-
23rd Aug 2011, 03:45 PM #10Respected Member
You are welcome.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Problem my display data php mysql
By softpk in forum Web Development AreaReplies: 1Last Post: 22nd Apr 2012, 11:42 AM -
How to recover deleted or lost data, file, photo on Mac with Data Recovery software
By Jack20126 in forum General DiscussionReplies: 0Last Post: 20th Dec 2011, 03:37 AM -
[Selling] MYSQL Data for sale. Assorted Hi-traffic forums, ecommerce, investment, media, warez
By felosi in forum Completed TransactionsReplies: 1Last Post: 15th Nov 2011, 05:59 AM -
replacing mysql $link supplied data, a question?
By XSLTel in forum Web Development AreaReplies: 10Last Post: 23rd Jul 2011, 03:14 PM -
Fetching Data from mysql database (Well Commented)!
By litewarez in forum Tutorials and GuidesReplies: 3Last Post: 9th May 2009, 03:36 AM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...