NOTE this is a php script... I do not know how to do this purely by
mysql... so you need to install php5 on your Linux system, save the
following script in a .php file located at /this/path/you/choose.php
and then in a terminal execute "php /this/path/you/choose.php"
(without quotes... replace "/this/path/you/choose.php" to the path of
your saved php file)

<?php
$cutnames = array();
$cutprefix = array();
$cutsuffix = array();
$cartnumbers = array();
$cutquantities = array();
$cutnamesO = array();
$prop = array();
$sqlconnection = mysql_connect("your mysql host", "your username",
"your password") or die(mysql_error());
$result = mysql_query("SELECT `Rivendell`.`CART`.`NUMBER` FROM
`Rivendell`. `CART` WHERE  `GROUP_NAME` LIKE  'YOUR GROUP TITLE';")
or die(mysql_error());
$count = 0;
while($row = mysql_fetch_assoc($result))
{
  $cartnumbers[$count] = $row['NUMBER'];

  // increment counter
  $count++;
}
sleep(3);
for($i = 0, $size = sizeof($cartnumbers); $i < $size; ++$i)
{
$result2 = mysql_query("SELECT * FROM  `Rivendell`.`CUTS` WHERE
`CART_NUMBER` =  '" . $cartnumbers[$i] . "';")
or die(mysql_error());
$count = 0;
while($row2 = mysql_fetch_assoc($result2))
{
  $cutnames[$count] = $row2['CUT_NAME'];
  $cutnamesO[$count] = $cutnames[$count];

  // increment counter
  $count++;
}
for($i2 = 0, $size2 = sizeof($cutnames); $i2 < $size2; ++$i2)
{
$result2 = mysql_query("UPDATE  `Rivendell`.`CUTS` SET `PLAY_COUNTER`
= '0' WHERE  `Rivendell`.`CUTS`.`CUT_NAME` =  '" . $cutnamesO[$i2] .
"';")
or die(mysql_error());
}
$cutnames = array();
$cutnamesO = array();
}
sleep(5);
mysql_close($sqlconnection);
?>

Please let me know how this works. This script was not tested... I had
to edit it on the fly from the one I use. If you get any errors please
let me know.

On Wed, May 9, 2012 at 7:43 PM, Patrick Schmalstig / WRRJ Radio
<[email protected]> wrote:
> Hey hang on I have a query I actually use myself that does just
> that... although not specific group but specific scheduling code.
>
> On Wed, May 9, 2012 at 7:39 PM, Jimmy Stinson <[email protected]> wrote:
>> My mysql script writing abilities are limited.  I found the script to
>> set the PLAY_COUNTER to 0 and would like to expand on it to set the
>> counter to 0 only in one GROUP or by using a key in one of the CART values.
>>
>> Thanks for any help,
>> Jimmy
>> _______________________________________________
>> Rivendell-dev mailing list
>> [email protected]
>> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev

Reply via email to