View unanswered posts | View active topics It is currently Sat Jun 25, 2022 10:09 pm



Reply to topic  [ 1 post ] 
 MySQL End Tag?!?!? HELP! 
Author Message
Junior Member

Joined: Thu Jun 26, 2008 2:58 am
Posts: 2
Post MySQL End Tag?!?!? HELP!
So I have a php script that tells MySQL to post 30 lines but sometimes I don't want it to post all 30 lines and to stop at say the 15th line depending on something.
Here is what it looks like (Yes it's messy but it's what I need):
{
$query = "INSERT INTO albuminfo(track,
details,
dl,
user,
trackn,
genre,
theyear,
art,
artist,
albumname)
VALUES ('$track_1', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_2', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_3', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_4', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_5', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_6', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_7', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_8', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_9', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_10', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_11', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_12', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_13', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_14', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_15', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_16', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_17', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_18', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_19', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_20', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_21', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_22', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_23', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_24', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_25', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_26', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_27', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_28', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_29', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname'),
('$track_30', '$details', '$dl', '$user', '$trackn', '$genre', '$theyear', '$art', '$artist', '$albumname')";
}
{
mysql_query($query) or die('YOUR FIELD WAS TO LONG!');
exit;
} }

So what I want to happen is for if track_24 is empty then to stop there and not post anymore lines. Seems simple enough but I just can't figure it out! Please help!

Thanks,
Spiceydog


Thu Jun 26, 2008 8:14 am
Report this post
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.