All Questions
194 questions
4
votes
2
answers
233
views
Querying for vendors and categories
I'm looking for pointers on the best way to optimize my code below. The query is designed to pull for a vendor database in a separate SQL server table that I built a connection to in my wordpress site....
-3
votes
1
answer
85
views
Preventing PHP SQL injection on login [closed]
I had a login code like this:
...
2
votes
1
answer
149
views
Extracting authors and books from XML and inserting them into PostgreSQL
There is a tree of start folder, it's subfolders, their subfolders, etc. In each folder, subfolder, etc. there are the same structured XML files stored.
books.xml
...
4
votes
3
answers
401
views
Queries to get products selected in multiple stores
Project description
I'm making a website listing products. The listing goes as following (See here):
Product name
Shop name
Price in that shop
If the product appears multiple times in the table for ...
0
votes
2
answers
220
views
Product list from database to web tables/boxes
I am a self-taught front-end developer, trying to land a job, the PHP and MySQL are quite new to me, since I only watched and did some code through Traversy Media courses.
This is a test project, ...
-3
votes
2
answers
179
views
Insert employee data into a database
I've constructed code using prepared statements to try and avoid chances of SQL injections. This code is meant to insert the employees information. It does what I need it to do but I want to know if ...
0
votes
2
answers
193
views
Version 2: Display visitor's number on your web page (changed code after getting answer for first version)
Version 2: Display visitor's number on your web page (changed code after getting answer for first version).
The first version is here: Display visitor's number on your web page
The "visitors&...
0
votes
1
answer
290
views
Display visitor's number on your web page
Display visitor's number on your web page.
The "visitors" table has only one column (visitor_count) and only one row. The column's initial value is 0.
I know goto should not be used but then ...
1
vote
1
answer
84
views
Updating multiple database tables when products are shipped back by customer
So, in this example I have to make these changes in my tables:
Select Product Data => SKU, QTY
Insert into shipping_back table
Update in shipping_back to current date
Update in customers to ...
1
vote
1
answer
90
views
Search controller logic to search through models and manufacturers
I have the following Laravel controller that searches through two models - Manufacturer and SearchTerm (which contains models of manufacturers, synonyms of models as well as common misspellings) using ...
2
votes
2
answers
179
views
Is this a good way to process an order? (SQL+PHP)
I'm making a simple webshop, it's not the full code, there are more security procedures. I'm just want to know your opinions. Thank you.
These SQL tables I have:
(I have more column in this table this ...
2
votes
1
answer
178
views
Prevent Column Name Collision
I have been working on a series of posts about a library to connect to databases but most of the scenarios I have to resort to some "JOIN" the problem arose when two or more tables had some ...
4
votes
2
answers
216
views
Using a transaction to create account records
This is my first time using commit and rollback. I just need to know if this is a proper execution of the functions for this particular situation:
...
3
votes
2
answers
372
views
Archiving / Moving Data from one database server to another database server
I am working on an SMS marketing project based on Yii2 Framework (PHP 7.3 & MariaDb (innodb engine)) where we have to move the logs from different tables to the archive db, which is total a ...
3
votes
2
answers
420
views
To-do app API made with Slim 3
I have put together the back-end (API) with the Slim framework (v3) and MySQL.
In index.php I have:
...