PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 2nd, 2000, 01:45 PM
tonyds tonyds is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Johannesburg, South Africa
Posts: 10 tonyds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I have a htm page where people select items via checkboxes - and the selected values get sent correctly to the PHP page as I include [] after the field name. I need some kind of loop to increment $i each time all the messages have been deleted - the for loop works nicely with 1 message which is checked, but when you check more than 1 it causes errors because it does not increase $1. Any suggestions ? :
$dbName = "dbane";
$MysqlName = "user";
$MysqlPW = "passwd";
mysql_connect("localhost");

for ($i=0;$i<sizeof($messno);$i++) {
mysql_connect("localhost",$MysqlName,$MysqlPW);
$SelectStr = "SELECT * FROM archive WHERE Messno = '$messno[$i]'";
$Results = MySQL($dbName,$SelectStr);
$RowCount = MySQL_NUMROWS($Results);
$messagelocat = "../clients/" . MySQL_RESULT($Results,$i,"Messagelocat");
MySQL($dbName,"DELETE FROM messages WHERE Messno='$messno[$i]'");
if (file_exists($messagelocat)) {
unlink($messagelocat);
}
else
{echo "There was no attachment to delete.";}

}
echo "<font face=Verdana><small>The selected

Reply With Quote
  #2  
Old March 3rd, 2000, 03:49 AM
tonyds tonyds is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Johannesburg, South Africa
Posts: 10 tonyds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Not to worry guys - I FINALLY figured out what I did wrong. Guess I just needed a night's sleep.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Multiple checkboxes - PHP3

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap