I am trying to update product price values, directly from database. I tried with the first 3 lines values, and everything goes fine at database level. The problem is that new values do not refresh at the web application.
I already clear cache, and re-built the product's index. But nothing happens.
Any suggestion?
Thanks.
if u want to change price directly in database you have to change it in product table and also in product_shop table.
Related
I created an ACF field for the user profile.
I want to insert data into an ACF Field on database level. I added two lines in the user_meta One for the group I want for the field. But on the user profile The field is empty.
Background: there is a value for every user from a separate system. I like to update every user with the specific value. My idea was to update the ACF on DB level.
I'm not sure I totally follow your situation, but by the sound of it, you are looking for...
update_field("field_name or field_id", "user_".$user_id);
Source
What is the best way to organize a big database.
The way it works is that only I am allowed to touch or modify the database but interns help sometimes to collect data, we used to have the whole system excel based, back than we had the macro which by choosing 2 files it will integrate and mark in colors the changes.
How can I create something friendly to use which will update by pressing a button and also will show changes!! I am familiar with the update query, however:
it doesn’t track any changes.
I want to know other options.
To sum up the way of processing is:
I have the database and I need to split some data to smaller files so other employees will work on.
Then I will collect the files and integrate with the existing database, but since we are all human mistakes can happened that’s why I want to be able to track easily changes.
The updates are going to happen often. When I will give the intern a temp. table The possible changes are for example: address, phone number, price, they will do those researches based on current data which they will find online which information has been changed, and they will change the info which is on the temp. table, That is why I want to be able to know what exactly did they found out. Lets say if Product A (product ID1234) used to cost 10$ and today its 12$ from the same supplier. I just want to know and to see that the price for product ID1234 has been changed. Not only to have it updated to the back end database. For quality assurance I need to track which new input they did in relation to the product ID. (some times input by someone else which was done in wrong format or wrong column could affect big time on the quality of the reports)
So this was the explanation for what I need the reports
So in order to make those temp. tables, I want to create a form for it that by choosing region, category etc. and then clicking on a button it will automatically select the relevant records from the database, create a new table/access-file and then copy the selected records to the temp. table. So someone else could work on it...
Next thing is that it would be nice to know how can I create a template for tables, by template I mean to standardize by validation rules. some fields I'd like to have dropbox menu, some fields ready mask for phone number.... etc.
Final part, after they made the changes and saved the file (the temp. table which they were working on), I want to be able to update the back-end database via clicking on a button...
Looking forward to get the best solution!
Thanks in advance J
Michael
Okay for the temp tables thing:
why not split your database in a backend part (having all the tables) and a frontend part which contain the forms and tables the interns need? I'm guessing mostly it is going to be the same so you can even create multiple different frontend's to give to different interns incase they need other tables. There are a lot of articles out there about splitting a database and linking tables.
Then the thing about the record changes not sure is this is what your looking for but it could help, i haven't used it myself so not sure what it exacly does. But this may help you a bit.
http://support.microsoft.com/kb/197592
I would consider taking a look at the BeforeUpdate event for the form. You can trap the old and new values of textboxes if the form is bound to a table. You could loop through all the controls on your form and check for Me.Control <> Me.Control.OldValue. If they don't match, write both values to an auditing table so you can go back and check whenever you want to. I would include the following fields in your auditing table:
ChangeDate
TableName
ControlName
OldValue
NewValue
Then you can query that table any time you want to see what has changed.
I am building a system whereby the user can build pages for a blog. The pages can contain images which obviously require manipulation and storage in folders. I am using the id of the SQL table row where the page data is stored as the basis for the folder name which stores the images for that page. The trouble is, sometimes this folder has to be created BEFORE the other page data has been inserted into the SQL table.
SO... how do I find what the ID of the NEXT insert will be?
I can't use the SELECT MAX(id) + 1 because pages may have been deleted in the meantime, reducing the max ID.
Any ideas? I am using codeigniter, so if anyone knows a library or method in CI that deals with this problem, that'd be ideal.
I COULD insert a dummy row, get the ID, delete it, then add one to the value, but seems like a bit of a hack?
Thanks
Try using LAST_INSERT_ID() function.
Basics about the database
I am working on a (relatively) simple database that stores inventory data. I am using Microsoft Access 2010 in order to do this. I have six tables with the following relationships:
Relationships of Database
I have created forms which combine the Transaction table with Ordered, Received, Allocated, or Dispensed. Each form requests an amount which will then be used to update On Hand, On Order, or Allocated (from the Material table) respectively.
The Problem
For example, my form to update Transaction and Order should be able to take in the Amount ordered, save all the data from the fields to the Transaction and Order tables as well as add the amount from Amount to On Order in the Materials table.
I have been working on this database for the past two days. I have searched several times for possible ways to perform a similar function, but have come up with nothing. All the tutorials I have found which seem remotely close to what I need to accomplish are for versions of Access which are much older than 2010. Unfortunately I have had little experience with the actual coding within Access, so I am stuck clicking around within the buttons on its menus.
What I have tried
Currently, the program is set to run the following Update query:
Screenshot of update query
This query works if I have one Material stored in the database but adds all the Amount values from Ordered to On Order every time it is ran, which is unfortunately not what I need it to do. I only need each Amount value added to On Order once.
You need to relate the Ordered and Material tables by adding a foreign key field to the Material table, ex. OrderedFK (Long Integer). This new field must be updated whenever a row is inserted into the Ordered table (assuming the "No" Field is AutoNumber). This is typically performed by using a Form (Ordered) and Sub-Form (Material) and setting the sub-form' Link Master (No) and Link Child fields (OrderedFK).
You can then join the Ordered and Material tables on the Update Query to achieve the desired result.
I have a web based inventory database setup so that when a user adds a new purchase order(PO) it is automatically inserted into the stocks table. Now, when I go to the grid view of my stocks table the inserted record shows up, but when I go check it out on the database it is not there, what seems to be the problem?
This is the link to my code: http://pastebin.com/download.php?i=BiYmDQt1
What is between your page and the database, do you add everything to an array or an xml file or something before writing it to the database, that your grid view reads from? can we see some code? :)
maybe the issue is related to this part being commented, out, or maybe its so late I am delirious
/* DbParameter parStockOut = dbStockInsert.CreateParameter();
parStockOut.ParameterName = "#Stock_Out";
parStockOut.Value = "";
dbStockInsert.Parameters.Add(parStockOut);*/
I've found the solution to my problem, looks like mysql workbench just shows the first 1000 records in a table so all I have to do is toggle row limitations for all records to show up.