Jump to content

[SOLVED] increment


redarrow

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.