redarrow Posted November 27, 2007 Share Posted November 27, 2007 does my increment look correct cheers........... <?php $a=array("music"=>"a.wav","document"=>"b.pdf","picture"=>"c.jpg"); foreach($a as $key=>$val){ echo "<br> <a href='folder/$val?cmd=".substr($val,-4)."'>$key </a> <br>"; } if($_GET['cmd']==".wav"){ $x=$cmd; $y="music"; } if($_GET['cmd']==".pdf"){ $x=$cmd; $y="document"; } if($_GET['cmd']==".jpg"){ $x=$cmd; $y="picture"; } $sql="update $y where $y=$y++"; $r=mysql_query($sql)or die(mysql_error()); ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 27, 2007 Share Posted November 27, 2007 men proper indention! use if else instead of if's or maybe switch.. $sql="update $y where $y=$y++"; $y== picture ? ? Quote Link to comment Share on other sites More sharing options...
redarrow Posted November 27, 2007 Author Share Posted November 27, 2007 you win lol solved thank you....... Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 27, 2007 Share Posted November 27, 2007 men what is this a joke! i mean being a super guru ! Quote Link to comment Share on other sites More sharing options...
redarrow Posted November 27, 2007 Author Share Posted November 27, 2007 i am not a guru a slow minded child sorry lol........ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.