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-31-2016 Ahhhhh! It was the $db-> thing! Thank yewwww! Running Update Query - Brandin - 01-03-2017 Here's another one to make me sound stupider I have a page that needs to change values in 3 tables when I press update. It changes the Code: dates Code: calls Code: orders Code: $date Code: $isactivate is undefined errors Code: isactivate Code: dates https://hastebin.com/wuvahisigu.php Running Update Query - mudmin - 01-03-2017 The isactive error is coming because you have that variable in your function, but you are not getting that info from anywhere. I'm guessing you mean status. What is the isactivate column supposed to have on it? Is it supposed to be a 1 or 0, yes or no? What data are you trying to get in there? Running Update Query - Brandin - 01-04-2017 Mudmin, Note my mispellings of Code: isactivate Code: isactive Code: isactive Code: isactive Code: ddfunction.php https://hastebin.com/asopijopoj.xml The Code: isactive Code: dates Code: orders Code: calls Code: isactive Thanks for your help. Running Update Query - mudmin - 01-04-2017 Let's take a crack at this. I'm going to guess that your procedural mysqli calls are right in your page itself, although I'm a bit rusty on that. I made a few changes to protect you against sql injections (hacks) on your $_GET variables. If this isn't it, it's pretty close...here is your function... https://hastebin.com/zajidawoqu.xml Here is your full page https://hastebin.com/zupudufuvo.xml If you are still having problems, this is what I would check. 1. Echo your date and make sure it's in the same format as the one in the database. 2. Double check your column and table names 3. Before line 57, I would do Code: die($date); Code: die($isactive); Running Update Query - Brandin - 01-04-2017 You sir, work wonders. I'm trying to get everything switched to PDO and injection proof but between coding new plugins for this system and work itself, it's hard to take the time! And I honestly cannot find a reason that it would be beneficial (other than the obvious) since I am currently the only one using the system. Prior to it being deployed to the entire team of more than 100 users, I'll definitely have to have it converted! Just not really a need right now. Mind you, it would probably make it easier in the long run so I don't have to manually do it later lol. Decisions, decisions! Thanks again Mudmin! Running Update Query - mudmin - 01-04-2017 haha. I get that. I'm going to work on putting out a video on the db class. I think it would be super helpful on this sort of stuff. Glad to help! Running Update Query - Brandin - 01-04-2017 That would be awesome! I think that's my biggest struggle, is learning how this system inserts, updates and queries the database. Although I can kind of grasp it by looking at the functions that are currently in the system, it is hard for me to fully understand how to adapt it to work with my new functions. Once I get told though, I understand! Lessons learned lol! Running Update Query - mudmin - 02-14-2017 I just posted a 35 minute video detailing how to use the database class. https://www.youtube.com/watch?v=rb0kD5tCENM&feature=youtu.be Running Update Query - Brandin - 03-17-2017 I just got around to watching this, and THANK YOU! That was hands down the most informative video I've watched when it has come to coding! Thanks again! |