A database is any organized collection of data organized to provide efficient retrieval.
1
vote
0answers
23 views
Improve my SQL select statement
I have three tables for a blog system.
The blog
CREATE TABLE IF NOT EXISTS lm_blog(
blog_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
title VARCHAR(80) NOT NULL UNIQUE,
action ...
3
votes
1answer
72 views
Generic method for database calls
Background
Breaking from MVC, I've implemented the following architecture:
POST/GET ➤ PHP ➤ Database Calls ➤ XML ➤ XSLT ➤ HTML
All database interactions are relegated to the call method in the ...
0
votes
1answer
17 views
Database “design” using Symfony2 and Doctrine2
I'm working on an application, which tracks expenses. I have users. Each user can create his categories for the expenses (like Food, Bills, Transport, Drinks, Clothes) and then create expenses - each ...
-2
votes
1answer
34 views
Is this a good use case for a database or will I be fine with tables? [closed]
I am doing a rebuild of a website that needs to be converted to responsive.
Originally, I was under the impression that the table of listings for locations of offices was perhaps under a hundred. ...
0
votes
0answers
14 views
Caching and indexing before persisting to DB [closed]
I'm quite in need for ideas for implementing indexing and caching on this code:
http://bit.ly/13SiKpW
Basically what I did was a proof-of-concept java.util.Map interface to the datastore and that ...
3
votes
1answer
176 views
asp.net (vb.net): handling of open database connection and calling shared function from web api
I'm working on an ASP.NET project using VB.NET that uses Dapper
and the code as implemented so far runs fine with just me testing.
In the example below, Dapper calls a stored proc.
But my I am ...
0
votes
0answers
75 views
Android database access
For my simple Android application I don't want to use an ORM, anyway I'd like to have a db-communcation layer easy to user, to read and efficient.
This is my solution: every entity (ex: Person) as an ...
2
votes
1answer
94 views
DAO Layer Code Review
Please review my following code for DAO layer.
public List<Channel> getListOfChannels() throws DataAccessException {
// will have the channel in form of List
// to hold the ...
1
vote
1answer
57 views
Keeping track of people's relationships in MySQL using a people relation table?
I am trying to track relationships among people. I came up with my own solution, but wondering if there might be another way or better way of doing this. To keep it simplified, I'll post just the bare ...
2
votes
1answer
66 views
Testing database table creation with NUnit
I'm new to using NUnit and have written a test to check for the existence of a database table. I have the below code that should check whether a new table named NewTable has been created in the ...
2
votes
1answer
50 views
ORM Entity with many similar relationships
To provide some background context, I'm implementing a web-based solution (Java, Spring, Hibernate) that allows the creation/authoring of task-centric workflow documents. Basically a workflow ...
1
vote
2answers
98 views
Make code looks more cleaner in the run method
I am trying to insert into Database using JDBC and each thread will be inserting into database. I need to insert into around 30-35 columns. I wrote a Stored procedure that will UPSERT into those ...
3
votes
3answers
52 views
Simplify things in the run method to look cleaner
I am trying to insert into Database using JDBC and each thread will be inserting into database. I need to insert into around 30-35 columns. I wrote a Stored procedure that will UPSERT into those ...
1
vote
2answers
107 views
PHP Class Inheritance / Object Instantiation / Object / Property Scope w/ Child / Parent Classes & Dependency Container Class
In PHP, I have a parent/child class and am using dependency container to load them. I am trying to use the same database connection on all of them without duplicating the object.
CLARIFICATION: MY ...
1
vote
2answers
89 views
First Database Schema - How did I do?
I would really like some advice from any DB gurus who have a few minutes free. After doing some reading and playing with sqlfiddle over the weekend I have constructed this postgresql schema and it is ...
0
votes
1answer
73 views
Nhibernate session and transaction implementation
In order to create loose coupling architecture on my web applications, I have created my own implementation for orm, in this case, nhibernate.
I want you please to review the code and tell me if you ...
0
votes
1answer
60 views
How to write a stable WCF service
I'm writing a WCF service for validating password and getting company ID for the clients that requests the services. The service runs on a server locally as a windows service, which sends queries to ...
0
votes
2answers
96 views
Backup a database over an SQL connection
Developing some industrial WinForms application for some industrial setting, I wanted to provide users of our software with a convenient way to back up the database the software uses (to send it to ...
0
votes
0answers
64 views
Building database from file C# Mysql
well as the question reads I am building a database with 3 tables. Now these tables are going to be used to store names in.
Table 1 will store First Names Table 2 will store Last Names Table 3 will ...
2
votes
1answer
221 views
Rails 3: How can I improve this ActiveRecord count
Here I retrieve a collection of causes from the database. Along with the information from each cause, I want to send the number of users in each cause. This way works, but if experience has told me ...
-1
votes
1answer
70 views
Connects to database but cannot get table [closed]
I use this php code to connect to my databse and retrieve the table food. I am able to connect to the database but no retrieve the table. I get this as a result: Host information: site.ipagemysql.com ...
1
vote
1answer
88 views
Improve and adding new method to GenericDataAccess?
I have this GenericDataAccess class to interact with database from my school just I want to ask for some suggestions and advice in how to to improve it and add new methods to for future use & ...
0
votes
0answers
106 views
Translation class with database back-end
From reading the faq, basically I would like if everyone could give me advice on all of the things enunciated there about my code (mainly design pattern usage and security):
Best practices and ...
3
votes
2answers
117 views
Javascript Coding Wager
I have two scripts written by my co-workers for auto-filling a form with information from the facebook graph-api. I am trying to figure out which has been coded in a more efficient style?
This is the ...
0
votes
3answers
56 views
What is the best way to save this? (saving the data generated by an application) [closed]
I have this code, and i want to save the generated data, but i don't know how, A database? a file? do i need to chance everyting in the code and start over again?
I'm from brazil, so the variables ...
2
votes
1answer
455 views
reusable data access class in C#
Below is my attempt at the beginnings of a reusable ado.net data access class. Please let me know of any improvements that I could make.
Thanks!
public class DataAccess : IDisposable
{
...
5
votes
1answer
369 views
PHP Login Authentication with BCrypt
So I have a php authentication script and everything works fine. But I'm very unsure about the way I programmed it (i hardcoded some stuff) and I was hoping stack could look through this and point out ...
2
votes
2answers
149 views
My database schema
I'm not sure if this would be okay to put here since it doesn't have code to look at, but this is my database I'm trying to create for an online firearm store. I'm new to database design and ...
4
votes
1answer
176 views
Please review my PDO Database wrapper
The subject is this small project - PHP/MySQL Database wrapper
The three main goals of this projects are:
Easy way to map database columns to object properties
Simple solution to insert or update ...
3
votes
1answer
124 views
Is my ERD design for “Adding Friends Capability” is good enough? [closed]
I have a school project to create a simple networking site, And I want to know if my database design is good. I'm open for any suggestions to improve my design thanks!
4
votes
1answer
73 views
Is this MySQL database structure acceptable or can it be improved?
Recently I've tried to teach myself basic things about MySQL databases, however I received some help on stackoverflow with creating a good database structure trying to avoid redundancy as much as ...
3
votes
1answer
111 views
Semi-Repost: How can I improve my PHP model for my html5/js mobile app?
I was advised, rightfully so, to simplify my question.
I am posting the a section of the model of my application.
Any/all feedback would be very helpful as I am trying to build my PHP skills, but I ...
3
votes
1answer
180 views
Is my base class constructed correctly?
I have tables that use BulkManager to save data to database.
I moved common functionality to BulkTableBase. Because creation of BulkManager depends on params of each Table I create the BulkManager in ...
4
votes
1answer
122 views
My first implementation of mongoDB
I'm new to Code Review, my assumption is that it is a place I can get feedback on working code that I've built, I hope that is right.
This is my first implementation of mongoDB, much much more to ...
2
votes
1answer
209 views
Is the following database class safe?
I was looking for a php class to handle all database operations (MySQL) and came across the following class. Someone please help me telling if this uses Prepared Statements correctly to make my web ...
2
votes
3answers
107 views
Referential MySql Design
How does this look? It has been over a year since my database concepts class and I have never worked with MySql. I have chosen InnoDB as my engine because of foreign key support using UTF-8 based on ...
3
votes
2answers
171 views
Best practices to protect a database from bad data
I'm just getting into SQL injection and data sanitization and seeking some advice on my script to get started. I have made this simple program which allows the user to enter their name into a form and ...
6
votes
2answers
379 views
Is this PDO wrapper structure dynamic? and can using self:: rather than $this cause problems?
<?php
class Database
extends PDO
{
/*@var mixed $stmt Used as a temporary variable to hold queries*/
private $stmt = Null;
/*@var $scopeSelectVar Used as a temporary variable to hold ...
3
votes
4answers
180 views
Should I break my DAO into one DAO class for each transfer object?
As a learn-by-doing project to learn java webapps I'm creating a website for registering and displaying happenings using JSP/Servlets, Apache Tomcat server, JDBC and a MySQL database.
I use JSP for ...
2
votes
1answer
105 views
Is this an efficient way of accessing the database
**EDIT I asked this question yesteday when I was unregistered, and now I can't seem to comment on the question or mark the answer as correct but I would like to say thank you for taking the time to ...
1
vote
1answer
186 views
Optimizing Rails 3 query code
I am working on a Rails 3 application, and am having some trouble with my user/edit view. In this application, Users can subscribe to Categories. Users and Categories have a has_and_belongs_to_many ...
11
votes
2answers
505 views
Learning C#, how to improve the following?
I'm pretty sure I may lose some reputation points for this post, but that's a small price to pay if I can learn more.
So I'm trying to teach myself C#. I'm finding the syntax a lot easier to deal ...
1
vote
1answer
131 views
Extracting Multiple Associative arrays in PHP
public static function find_user_tracks($id)
{
global $mySQL;
$sql = "SELECT * FROM `tracks` WHERE account_id = {$id}";
$result_set = $mySQL->query($sql);
$ret = array();
...
0
votes
1answer
534 views
Data Structure for Categories and SubCategories
I have this relationship:
Many Objects to One Category
One Category to Many SubCategories
I am looking for the best way to store this in my Relational Database? Here were some of the ways I was ...
1
vote
0answers
54 views
Sanity check on grouping query
I have a table containing URLs as they should appear in English and equivalent translations of them into other languages. Originally, I was told that there would always be an English translation, so ...
1
vote
0answers
156 views
Monthly rollover system
I have learned a little python for a few projects at work. This is my first "finished" application and I was hoping someone would take a look at it. I would love some tips on the noob mistakes I am ...
1
vote
3answers
149 views
Program that runs correctly on GDB but not from Terminal [closed]
UPDATE
This post has been closed because my program actually had an error even though it worked in GDB so technically it wasn't meant for reviewing. However, after the help of some of friends here, I ...
1
vote
1answer
1k views
how to properly use database connections in PHP classes
I need some advice\suggestions on how to create\handle database connections for a project I'm working on. I'm creating a simple work order system for my company using PHP 5.4.3, right now there isn't ...
0
votes
1answer
51 views
Structuring data in an Android application [closed]
I originally posted this question on StackOverflow but was told to move it here.
I have an application that I have been developing for the last two years, and over the course of time it has become ...
1
vote
2answers
158 views
How to Improve This Program, Add Comments, etc.?
Do you have any suggestions to improve or extend this script? Any ideas for removing or adding comments/docstrings?
import dbm
import subprocess
import time
subprocess.call("clear")
try:
# Tries ...