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()); ?> Link to comment https://forums.phpfreaks.com/topic/79029-solved-increment/ 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 ? ? Link to comment https://forums.phpfreaks.com/topic/79029-solved-increment/#findComment-399933 Share on other sites More sharing options...
redarrow Posted November 27, 2007 Author Share Posted November 27, 2007 you win lol solved thank you....... Link to comment https://forums.phpfreaks.com/topic/79029-solved-increment/#findComment-399936 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 ! Link to comment https://forums.phpfreaks.com/topic/79029-solved-increment/#findComment-399937 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........ Link to comment https://forums.phpfreaks.com/topic/79029-solved-increment/#findComment-399941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.