The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running Update Query
#1
Hey!

I am using the UserSpice pages in many ways, and one of them is a migration tool. Basically, I have a list of categories, and if I migrate the category number to be another number, I also want to update all of the templates with that category number, to the new one. Currently, I am using the default function from the
Code:
admin_user.php
page that I just modified to my good, and I have this:

<pre>
Code:
//Update catnum

    if ($number != $_POST['number']){
       $number = Input::get("number");

      $fields=array('number'=>$number);
      $validation->check($_POST,array(
        'number' => array(
          'display' => 'Number',
          'required' => true,
          'min' => 1,
          'max' => 3
        )
      ));
    if($validation->passed()){
      $db->update('categories',$id,$fields);
      $successes[] = "Sort Updated";
</pre>


But what I need to do is also update the
Code:
templates
table
Code:
WHERE category=
the new
Code:
$number
I have set.

If you could help with the
Code:
$db->
function for this, I would be VERY appreciative Smile

Thanks again!
  Reply


Messages In This Thread
Running Update Query - by Brandin - 12-03-2016, 09:31 PM
Running Update Query - by Brandin - 12-03-2016, 09:31 PM
Running Update Query - by mudmin - 12-19-2016, 02:35 PM
Running Update Query - by Brandin - 12-19-2016, 02:37 PM
Running Update Query - by Brandin - 12-22-2016, 06:52 PM
Running Update Query - by mudmin - 12-22-2016, 06:56 PM
Running Update Query - by Brandin - 12-26-2016, 06:50 PM
Running Update Query - by mudmin - 12-28-2016, 02:54 PM
Running Update Query - by Brandin - 12-28-2016, 03:01 PM
Running Update Query - by mudmin - 12-28-2016, 03:03 PM
Running Update Query - by Brandin - 12-28-2016, 03:03 PM
Running Update Query - by mudmin - 12-28-2016, 03:05 PM
Running Update Query - by Brandin - 12-28-2016, 03:07 PM
Running Update Query - by mudmin - 12-28-2016, 03:08 PM
Running Update Query - by Brandin - 12-28-2016, 03:09 PM
Running Update Query - by mudmin - 12-28-2016, 03:34 PM
Running Update Query - by Brandin - 12-30-2016, 03:07 PM
Running Update Query - by mudmin - 12-30-2016, 05:09 PM
Running Update Query - by Brandin - 12-30-2016, 06:00 PM
Running Update Query - by dan - 12-31-2016, 02:30 PM
Running Update Query - by Brandin - 12-31-2016, 02:38 PM
Running Update Query - by Brandin - 01-03-2017, 04:10 PM
Running Update Query - by mudmin - 01-03-2017, 10:34 PM
Running Update Query - by Brandin - 01-04-2017, 12:08 AM
Running Update Query - by mudmin - 01-04-2017, 02:08 AM
Running Update Query - by Brandin - 01-04-2017, 02:21 AM
Running Update Query - by mudmin - 01-04-2017, 02:22 AM
Running Update Query - by Brandin - 01-04-2017, 02:24 AM
Running Update Query - by mudmin - 02-14-2017, 01:52 PM
Running Update Query - by Brandin - 03-17-2017, 04:55 PM
Running Update Query - by Brandin - 03-18-2017, 02:03 AM
Running Update Query - by mudmin - 03-19-2017, 10:52 PM
Running Update Query - by Brandin - 03-19-2017, 11:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)