Current location: Hot Scripts Forums » Programming Languages » PHP » Need help writing a script


Need help writing a script

Reply
  #1 (permalink)  
Old 09-01-05, 08:07 PM
Strictn9ne Strictn9ne is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Need help writing a script

alright i am not to smart when it comes to coding so please if anyone has the spair time to help me complete this script i will be majorly appreciated and i cant offer much but if you have a link or banner i will display that **** for free for life not a major thing or anything but its extra advertising hehe

okay heres what i need done

Code:
<? 
$i=0; 
require("config.php"); 
$sql=mysql_query("SELECT name,count(name) as cnt FROM requestlist WHERE name!='' GROUP BY name ORDER BY cnt DESC LIMIT 705"); 
while($data=mysql_fetch_object($sql)) 
{ 
   $i++; 
    echo "<font face=tahoma size=1 color=#c0c0c0>".$i."<font color=#c0c0c0>) "; 
    echo "<font face=tahoma size=1 color=#c0c0c0>".$data->name." (<font color=#c0c0c0>".$data->cnt." <font color=#c0c0c0>requests) <br>"; 
} 
?>
right now the above code is grabbing the top requests made from the radio

now thats cool and all but i need to do my own little addition

this is what i need to achieve and all that is involved.

first i need to grab a single name from the requestlist table were gonna go with example name *ted*

now i want to first have the script post

Ted then a line break
and then i need the script to grab teds songs he requested. now this is where its confusing to me in the request table Ted's requests become a songid now i need to call them song id's that match the name ted

so

Ted
123432
23342
34232
32
1213
12113

and so on

now this is where its even more tricky
i need to convert the songid's to be converted instead of displaying as numbers it needs to then take the songid number and grab the songid number from another table called songlists

now in that table the id is now just called id instead of song id
so it will have to grab songid from requestlist and then convert that id to grab from the songlist id table. now that we got that info. we need to echo the song information. so in the songlist table there the id of the song then in that table theres also artist and song so the code needs to take the id and use the artist and song info from that id and echo just the name of the artist and song.

now to go back to the beginning this all has to be done so when it grabs the requesters name it just shows that requester and then under his name it would dispaly the songs one line after another till the requester didnt have no more.


now to spice it up a little more. i would want to achieve it so if the requester requested the same song three times or something it would not show that and instead just show that song and ( 3 times ) next to it

Now to spice this up even more i would want this to be able to start the grab by using a members name from the actual site

Last edited by Strictn9ne; 09-01-05 at 08:09 PM.
Reply With Quote
  #2 (permalink)  
Old 09-01-05, 09:14 PM
Strictn9ne Strictn9ne is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
TABLE `requestlist` (
  `ID` mediumint(9) NOT NULL auto_increment,
  `songID` mediumint(9) NOT NULL default '0',
  `t_stamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `host` varchar(255) NOT NULL default '',
  `msg` text,
  `name` varchar(255) NOT NULL default '',
  `code` mediumint(9) NOT NULL default '0',
  `ETA` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` enum('played','ignored','pending','new') NOT NULL default 'new',
  PRIMARY KEY  (`ID`),
  KEY `t_stamp` (`t_stamp`)
) TYPE=MyISAM AUTO_INCREMENT=302 ;
theres the table for request list

Code:
TABLE `songlist` (
  `ID` mediumint(9) NOT NULL auto_increment,
  `filename` varchar(255) NOT NULL default '',
  `diskID` mediumint(9) NOT NULL default '0',
  `flags` varchar(10) NOT NULL default 'NNNNNNNNNN',
  `songtype` char(1) NOT NULL default 'S',
  `status` tinyint(4) NOT NULL default '0',
  `weight` float NOT NULL default '50',
  `balance` float NOT NULL default '0',
  `date_added` datetime default NULL,
  `date_played` datetime default NULL,
  `date_artist_played` datetime default '2002-01-01 00:00:01',
  `date_album_played` datetime default '2002-01-01 00:00:01',
  `date_title_played` datetime default '2002-01-01 00:00:01',
  `duration` mediumint(9) NOT NULL default '0',
  `artist` varchar(255) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `album` varchar(255) NOT NULL default '',
    PRIMARY KEY  (`ID`),
  UNIQUE KEY `ID` (`ID`),
  UNIQUE KEY `filename` (`filename`),
  KEY `date_played` (`date_played`),
  KEY `date_artist_played` (`date_artist_played`),
  KEY `date_album_played` (`date_album_played`)
) TYPE=MyISAM AUTO_INCREMENT=75822 ;
theres the songlist table


now in the above post i said i needed to grab the artist and song but its actually artist title from the second table

so theres the two tables were working with and need to call from.
first one wuill grab the requests. then second one has the song information in it. so got to grab the name and songid from the first. and convert that info to grab the id from the second table and then echo

requester name
then there songs they requested.

Last edited by Strictn9ne; 09-01-05 at 09:18 PM.
Reply With Quote
  #3 (permalink)  
Old 09-02-05, 12:25 AM
Strictn9ne Strictn9ne is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
is this really hard ? to achieve
Reply With Quote
  #4 (permalink)  
Old 09-02-05, 04:41 PM
Strictn9ne Strictn9ne is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Strictn9ne
is this really hard ? to achieve
cant even get a reply like this is not possible or this is very hard to achieve or i wouldnt have a clue come on people at least point me the right way to start at least
Reply With Quote
  #5 (permalink)  
Old 09-02-05, 05:29 PM
Kevinmiam Kevinmiam is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
PM Me, I think it can be done.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Your Own Profitable and VERY unique eBusiness Voltaire General Advertisements 3 03-30-10 06:36 AM
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 07:15 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 12:12 AM
need help writing script to let user edit thier html or php files pinochio53 PHP 14 12-15-03 07:26 AM


All times are GMT -5. The time now is 07:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.