The following warnings occurred: | ||||||||||||||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Running Update Query - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Off-topic Discussions (https://userspice.com/forums/forumdisplay.php?fid=10) +--- Thread: Running Update Query (/showthread.php?tid=381) |
Running Update Query - Brandin - 12-03-2016 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 <pre> Code: //Update catnum But what I need to do is also update the Code: templates Code: WHERE category= Code: $number If you could help with the Code: $db-> Thanks again! Running Update Query - Brandin - 12-03-2016 I posted this on HasteBin since it went crazy on here: http://hastebin.com/ehefapokas.php Running Update Query - mudmin - 12-19-2016 I missed this one. I was on vacation. Did you get it figured out? Running Update Query - Brandin - 12-19-2016 I did - I'll pull the code to let you know what I did later today. Hope you enjoyed your vacation! Running Update Query - Brandin - 12-22-2016 Now when I am running the update query this happens: Warning: Invalid argument supplied for foreach() in /home/aircentralized/public_html/boss/users/classes/DB.php on line 50 Warning: Invalid argument supplied for foreach() in /home/aircentralized/public_html/boss/users/classes/DB.php on line 50 Line 50 is: Code: foreach ($params as $param) { Thanks. Running Update Query - mudmin - 12-22-2016 PHP didn't give you the most helpful error there. That error is part of the db->query method, so there is a problem with one of your queries. Go through any time you did any db queries on that page and see if there are any errors... If you're kind of lost on where you messed up, just put die(); after a query (starting from the top of the page) and reload the page. If you don't get that error, remove that die and put it after the next one. Once you get the error, the query before the die is the one that is causing you a problem. Running Update Query - Brandin - 12-26-2016 Hey mudmin, I've tried doing this but it ends up stopping the page from loading because I'm using die(); in queries that load the page. This only happens when I actually perform an update, so it seems as if is something to do with the update query, but this is the same query from the default UserSpice pages, just modified for this purpose (only change the update values and table and stuff). It occurs on every page after I perform an update function. Thoughts? Running Update Query - mudmin - 12-28-2016 Can you pastebin the latest version of this code and I can figure it out for you? Running Update Query - Brandin - 12-28-2016 Code: templatesreqedit.php This performs an update, and then gives me the error above, which is linked to the DB.php file which is here: https://hastebin.com/ikoyugutiz.xml Excuse this mixed use of mysqli queries and PDO lmao - I'm still trying to convert all of my stuff to PDO. Running Update Query - mudmin - 12-28-2016 So just double checking...did you modify the db class? |