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
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
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)

Pages: 1 2 3 4


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 Wink I have a page that needs to change values in 3 tables when I press update. It changes the
Code:
dates
table properly, but I need it to update the
Code:
calls
and
Code:
orders
tables based on the
Code:
$date
value which is already defined. I am trying to replicate this using the approve functions you wrote for me, but it's not liking me. It keeps throwing
Code:
$isactivate is undefined errors
on my page.
Code:
isactivate
defined when the update is performed? Clearly it is because it does it in the
Code:
dates
table.

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
instead of
Code:
isactive
lol. It is all correct in the code though. The
Code:
isactive
column is used in other portions of the system to verify if to include that call, order or date in the stats calculations.
Code:
isactive
is 1=Yes or 2=No, table defaults this column as 1. I have included the
Code:
ddfunction.php
page as a whole below:
https://hastebin.com/asopijopoj.xml

The
Code:
isactive
column is pulled from the DB, and is defined prior to the forms posted, and is defined again when the form posts, by the update query. So this properly updates the
Code:
dates
table, however when the validation runs the function to update the
Code:
orders
and
Code:
calls
table, it seems to not be able to pull the new
Code:
isactive
value. Why would this be?

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 Smile
3. Before line 57, I would do
Code:
die($date);
and then
Code:
die($isactive);
to make sure you have the right info there.






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!