Help with SQL in a new Module

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Help with SQL in a new Module
mrbeanbag
CZ Newbie
mrbeanbag has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 01, 2003
0.00 posts per day
Posts: 5
Points: 1,567
   
Im making a new module to help sort out my videos on my site. The first version used no sql and was hard to add new stuff. This time i want to use sql to store the file location, width, height, and name of the video. I would also like to add and modify from admin.

What i want it to do is show the video with the selected height and width using cid. the videos will be accessed directly from EDL as a download and not from the front page of this module.

As i have no idea how to use sql so if anyone could help me set up the sql part of this module. I already have the design. Of course ill give credits to whoever helps in any way.



Back to top Reply with quote
#2   re: Help with SQL in a new Module
mrbeanbag
CZ Newbie
mrbeanbag has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 01, 2003
0.00 posts per day
Posts: 5
Points: 1,567
   
well... i tried and with some success

heres the code i used:

function flash($cid) {

    global $prefix, $dbi;
    $result = sql_query("select cid, title, width, height, file, colour, id from ".$prefix."_downloads_categories where cid=$parentid", $dbi);
    list($cid, $title, $width, $height, $file, $colour, $id) = sql_fetch_row($result, $dbi);
    $cid = intval($cid);


include("modules/DownloadManager2/Addons/Flash.php");

}


and when i acces it with: [ Register or login to view links on this board. ]

i get the error:


Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home2/beanbagw/public_html/includes/sql_layer.php on line 286


And i made sure that the tables are in the correct order and have data so im not sure whats the problem since this is the first time i am using SQL.


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum