Hi all,
I'm writing a function that when called, will insert a new 'show_listing' into the column called show listing in the database. Then, bump the rest of the suceeding show_listings by one. I've got it half working with you attempt to call the function by inserting a future show into the past, but I cant get it to work the other way.
Any help is great, thanks,
john
sorry if that's kind of cryptic, if you need any other info just let me know
I'm writing a function that when called, will insert a new 'show_listing' into the column called show listing in the database. Then, bump the rest of the suceeding show_listings by one. I've got it half working with you attempt to call the function by inserting a future show into the past, but I cant get it to work the other way.
Any help is great, thanks,
john
sorry if that's kind of cryptic, if you need any other info just let me know
function insertShowListing( $node_element, $future_node, $date )
if($node_element > $future_node)
mysql_query("UPDATE `$date` SET
`show_listing`='t' WHERE `show_listing`='$node_element' ");
for($i=$node_element-1; $i>=$future_node; $i--)
$new_num = $i + 1;
mysql_query(" UPDATE `$date` SET
`show_listing`='$new_num' WHERE `show_listing`='$i' ");
mysql_query("UPDATE `$date` SET
`show_listing`='t' WHERE `show_listing`='$node_element' ");
for($i=$future_node; $i>$node_element; $i--)
$new_num = $i - 1;
mysql_query(" UPDATE `$date` SET
`show_listing`='$new_num' WHERE `show_listing`='$i' ");
mysql_query("UPDATE `$date` SET
`show_listing`='$future_node' WHERE `show_listing`='t' "); 