I understand how to generate objects from the database, using Sinatra with formatting, and I understand from tutorials how to use POST to send information back, but I don't understand how to use POST to transfer information from the browser (for instance from a text field, or inside <p id="stufftotransfer"><%= @stuff.each do || stuff.name %></p>) back to the database and store it to show it's working. Basically in Sinatra, if you want to display something as output you do something like this -> application_controller.rb get '/items' do erb :items #for example end #Actually this is items.erb for instance. I can't …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am developing a mobile app for a health care institution. I'd like to get a suggestion on how to approach my database design. There are many user types of this app; residents, nurse, and general-staff. The "resident" has many information that other types don't have; unit_number, food_allergy, emergency_contact, next_kin_name, next_kin_phone, emergency_doctor, nurse_in_charge, medications. The "nurse" has distinct information than others; working days, shift, patients, qualifications, etc. The "general-staff" has; department identifier (clinic, store location) I have put common attributes in one table ("user_table"), such as; id(pk), name, phone no, date of birth, address. *My question is, how do …

Member Avatar
Member Avatar
+0 forum 3

Hello Guys, Good Day. I have this kind of error `OperationalError: no such table: table_name` when I make a query like `modelname.objects.all()` in **manage.py shell**. But I already did the ff: 1. settings.py > Databases > django.db.backends.postgresql_psycopg2 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), }, 'db_foo': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'db_foo', 'USER': 'user_foo', 'PASSWORD': 'pwd_foo', 'HOST': '', 'PORT': '', } } 2. manage.py syncdb 3. `from appname.models import modelname` Did I missed something to configure? Thanks. Long Live Daniweb!

Member Avatar
Member Avatar
+0 forum 1

Structures of my tables are as follow. Table Name : timetable [Image1](http://www.4shared.com/download/MYafV7-6ce/timetableTable.png) Table Name : slot_table [image2](http://www.4shared.com/download/9Lp_CBn2ba/slot_table.png) Table Name : instructor(this table is not required for this particular problem) I want to show the resultant data in my android app in a timetable format somewhat like this: [image3](http://www.4shared.com/download/oAGiUXVAba/random.png) **Question** : What query i should write so that subjects of particular days with respective slots will be the result of the query? 1)The days should be in order like monday,tuesday,wednesday. 2)If monday has 2 subjects in 2 different slots then it should display like this : Day 7:30-9:10AM 9:20-11:00AM Monday Android …

Member Avatar
Member Avatar
+0 forum 1

Hello guys!! I have a database and I store public tweets inside. I have lots of columns, including timestamp with timezone column. For example: timestamp | tweet_id "2013-07-30 11:14:07.404+03" 6598dsf4466a "2013-07-30 11:14:08.028+03" 87f9dss99s97 ... "2013-08-04 17:36:37.924+03" 646s4f64a64 "2013-08-04 17:36:38.891+03" 654asd9f654a So, I want to make clusters (time clusters) with these results For example hourly clusters "break" results to hour interval The result that I want is ids | hour {123,654,468,4698,654,..} 12 {6s4f6a,ghj,ghjth,654,....} 13 or with minute clustering ids | minute {123,654,468,4698,654,..} 12 {6s4f6a,ghj,ghjth,654,....} 13 what I am doing now is to run my query public function getHourClusters ( $specDay ) …

Member Avatar
Member Avatar
+0 forum 1

I have a CTE based query, to which I pass about 2600 4-tuple latitude/longitude values using joins - these latitude longitude 4-tuples have been ID tagged and held in a second table called coordinates. These top left and bottom right latitude / longitude values are passed into the CTE in order to display the amount of requests (hourly) made within those coordinates for given two timestamps).- I am able to get the total requests per day within the timestamps given, that is, the total count of user requests on every specified day. (E.g. user opts to see every Wednesday or …

Member Avatar
Member Avatar
+0 forum 1

Hi Thgin i seek is to create a connection (android) to the latest postgresql 9.2 database. Theat is running on a distant server. Can i Do it? Is postgre 9.2 JDBC driver fro andoid out? & little bit distant question. If the prevous is doable. How i an write tet (juint ect) for database code testing? If the postgresql 9.2 and adroid is imposssible. Can you maybe suggest a another alternative? For ecaple some public sql solutions. Im familiar with mysql, postgresql and access SQL :O. Thank you in advance!

Member Avatar
Member Avatar
+0 forum 3

I want to write a wrapper around MySQL but I will in future extend it to support other databases. I will cover only nasic useful features (commons) but it should be extensible in future with minimal change. I want to write an interface but I cannot get good tutorial to glean wisdom from. I will be glad to hear your comments and pointers. Don't worry about re inventing the wheel, much of the time is funny way of learning ;)

Member Avatar
Member Avatar
+0 forum 4

A new version (9.0) of [URL="http://www.postgresql.org"]PostgreSQL[/URL] is in beta and ready for public testing. If version 9.0 lives up to its proposed [URL="http://www.postgresql.org/about/featurematrix"]feature list[/URL], then it is serious competition for MySQL. PostgreSQL proponents have long suggested that PostgreSQL has always enjoyed superiority over MySQL. I beg to differ but that may be changing. I tried using PostgreSQL several times over the past few years, beginning with version 6.x. I received it on CD for review. It was OK. Nothing thrilling or special. I did think it was an ambitious project but at the time, I didn't really care much for …

Member Avatar
Member Avatar
+0 forum 16

I have run into an interesting problem. I have inherited a database for daemon process that polls and accepts reports from remote embedded systems. Each site that has one of these systems can monitor over a dozen different fuel tanks. (In practice, most monitor 2, 3 or 4 tanks.) When something happens, such as a tank being refilled or a tank reaching a minimum level, the program saved that event in a Postgres database. The way the database was originally constructed, it was saving all the information from each fuel tank (type of fuel, etc.) in the event record, even …

Member Avatar
Member Avatar
+0 forum 2

I hope the title made sense. ok ive got a table in a PostgreSQL database that has a few coloumns in it. What im tryting to do is the following: [CODE]<?php $totaltimetodayresult = pg_query($link, "SELECT SUM(acctsessiontime) AS totaltime FROM radacct WHERE acctstarttime LIKE '%".$today."%'"); while($totaltimetodayarray = pgfetch_array($totaltimemonthresult)){ $totaltimetoday = $totaltimetodayarray['acctsessiontime']; } if($totaltimetoday == ""){ $totaltimetoday = 0; }else{ echo "<li>Today - $".$totaltimetodayarray['totaltime']."</li>"; } ?>[/CODE] Now this keeps coming back with it not liking the "LIKE" if I put single quotes around 'acctstarttime' it comes back with null. acctsessiontime = timestamp with timezone (2010-07-27 09:08:27+12) acctstarttime = bigint $today = 2010-07-27 …

Member Avatar
Member Avatar
+0 forum 2

Hi All, I am trying to start writing a wiki-ish CMS I've been contemplating for a while now. the content will include pics, html content, and should be stored in a database (the current pick is postgres) A few questions for the more experienced folk 'round here: 1. how do I plan such a database - is there a ready-made data type for a webpage, or do I need to build a table for every component (e.g. pictures). Is there a ready template for such a thing? 2. Python web frameworks - which would be best suited for this? Django …

Member Avatar
+0 forum 0

I am working on a psycopg2 application for a customer. I first used: SELECT * from table which worked fine with 'cursor.fetchone()'. But due to some technical details between the customer's database and the database on my company's side where I could not depend on the order of the fields, I had to switch to SELECT fld1, fld2, .... fldN FROM table This case appeared to work, but the cursor returned a tuple of only 1 item, containing the 'stringification' of the fields, separated by commas. This is obviously wrong, and would be easy to workaround except that the data …

Member Avatar
Member Avatar
+0 forum 2

i am having some connectivvity issues i am using postgres 9.0 sql db i have installed a dns localhost using the postgres sql driver also i have the jdbc jar files in the lib dir of the tomcat my code is [CODE] <%@ page language="java" import="java.sql.*" %> <% Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/sample", "postgres", "ankur"); Statement stmt = conn.createStatement(); String StrUser = request.getParameter("username"); String Age = request.getParameter("age"); stmt.executeUpdate("INSERT INTO tab1 VALUES ('ankur',21);" ); stmt.close(); conn.close(); %>[/CODE] the error generated is avax.servlet.ServletException: org.postgresql.util.PSQLException: ERROR: syntax error at or near "[" Position: 18

Member Avatar
Member Avatar
+0 forum 8

Hi there, I have started working on a new C# app which will be installed directly onto our customers' computers to access our services remotely. I'm still in the phase of planning how everything will fit together. I normally use PostgreSQL for our back-end database needs, but I can't think that it'll be very practical to ship this app with PostgreSQL or even SQL Server. Will it be better to use XML or maybe use SQLite for a local database? I only want to use the database to remember some of the statistics that will be important to the user …

Member Avatar
Member Avatar
+0 forum 1

I want to store data that user inputs [form based in form of xml] into a postgres database, so I would like to know is it wise to develop a web service or how do I transfer data. I am completely clueless how to head on with the problem

Member Avatar
+0 forum 0

Hi. I am working on a visual C++ app and I was wondering if it is possible to use PostgreSQL for database interaction instead of the default SQL Server? I saw a connector for .NET but it's written in C#, will that work for a C++ app also? Or is there some other PostgreSQL C++ connector for .NET? Any help will be greatly appreciated...

Member Avatar
Member Avatar
+0 forum 3

Hello everyone, I am currently creating a small JS app. that will help me search PostgreSQL and print related data via PHP. I am using jQuery to help me but I have this small problem. I wanted to test if the code worked, by prompting the PHP file to print a random text before moving on to data but I had this error in Firebug -nothing is printed as an output-: "Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead. [Break on this error] $.post('file.php', {name: form.name.value }," my javascript and php code are below: JAVASCRIPT …

Member Avatar
Member Avatar
+0 forum 2

Hello everyone, I am trying to retrieve some data from PostgreSQL using jQuery and PHP. I should be able to enter a date as input -e.g, as 2010-08-09 and retrieve all the data that is dated August 9th- however, when I execute my javascript, all I get as an output is this: "; echo " ".$rows['misc.sp_archive.timestamp']." -by the way, misc.sp_archive is the sql table, timestamp is the date element of table- "; } ?> My code is as below Javascript Part [code] <head> <style type="text/css"> #age{ display: none; line-height: 0px; font-size: 20px; } </style> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> function …

Member Avatar
Member Avatar
+0 forum 5

There are 2 questions that I have. After banging my head with mysql server for more than 4 hours, I've given up. The mysql server will start mysql service on windows 7, but will not start another service. (Is this somehow related to admin rights of 7. I am an admin by the way.) It won't start even the basic mysql service on windows XP and there is a socket related problem on my slackware 13.0. I've searched everywhere on the internet and the tweaks which work on other people's pc will not work on mine. So here are the …

Member Avatar
+0 forum 0

Hey, I need help with setting up an authentication code. I am currently working on a project to build a blog server in python for an intro level python course. We are using the PESTO and POSTGRESQL wsgi and sql clients respectively. I am trying to authenticate against a user name and password in the database and myself and I suspect my partner are becoming incredibly frustrated with the lack of progress being made. If we could get the authentication script working, everything else would fall into place. [code] import time, os import pesto import logging #import pgdb os.environ['PATH'] +=";C:\\Program …

Member Avatar
Member Avatar
+0 forum 3

The End.