Hi All, in sqlite SMALLINT datatype is used to store 2 bytes integer but i didn't see any Unsigned SMALLINT type to support the range(0-65535). Can anybody let me know how to achieve the same.

Member Avatar
Member Avatar
+0 forum 1

Hey guise, I have a uni assignment; setting up backend code for a tour company website. Everything's gone swimmingly but I've run into issues implementing a system for rating the tour packages. Implementation for the rating system: user clicks rate button, the rating score is added to a running total and the tally of ratings is incremented by one. The average rating is returned by using php to divide the running total by the tally of ratings. I don't have a table of individual rating scores, just three fields TotalRatings = the cumulative total of ratings RatingNo = the tally …

Member Avatar
Member Avatar
+0 forum 2

I'm creating a small and simple app to use with my poker league. I've created a small DB that I simply enter the player name, who took them out, and what place they went out in. All of that works just fine. What I need to do is implement the point system that I use so that the points column in the database is automatically populated with the players points based on when they went out of the tournament. I don't have my code with me on this computer, so I'll explain the process as best I can here. Heres …

Member Avatar
+0 forum 0

Hello!!I have a database and I want to display its data into a QTreeView in PyQt.The database's column has file paths.I have a problem in filling this treeview with data because it's a database and I'm not sure if it is like working with txt files and because it is file paths.I heard that I should use proxy models,but I am not sure how to do this or if this is the right thing to do and I can't find any relevant examples...I would appreciate any help.Thank you in advance!

Member Avatar
Member Avatar
+0 forum 4

Hello. When we want to insert a vlue into a table in sqlite, we use this line, right? cursor.execute('INSERT INTO colors Values ("red", "blue")') As we can see above, we want to insert 2 words and we type them as when we are typing whole the codes. But i want to get 2 words from input and insert them into the table in sqlite. I'm using Entry box in Tkinter window and i want something like this: ent = Entry() ent.grid() ################ cursor.execute('INSERT INTO colors VALUES (ent.get())') But it doesn't work and give me a syntaxt error. What can i …

Member Avatar
Member Avatar
+0 forum 17

Hello everybody. How can i get "ls" from shell scripting? I tried this but it doesn't work, i saved it in a file: #!/bin/bash $ls I know the second line is not correct, so what should i type? Getting "ls" is just an example, i infact want to import this line to the shell: sqlite3 test.db to create a database.

Member Avatar
Member Avatar
+0 forum 2

Hi guys i have an sql query string that in my view there is something wrong with it but i an handicaped since i am very new to sql so my question is, is there any way of optimizing this query string select t1.cat,t1.site from (select cat,site from news where site='myjoy'and cat='business'limit 3) t1 union all select t2.cat,t2.site from (select cat,site from news where site='pea'and cat='business'limit 3) t2 union all select t3.cat,t3.site from (select cat,site from news where site='myjoy'and cat='sports' limit 3) t3 union all select t4.cat,t4.site from (select cat,site from news where site='pea'and cat='sports'limit 3) t4 union all select …

Member Avatar
Member Avatar
+0 forum 1

Hi guys i have a table with this data ______________ | site | cat | ______________ | my | sp | | my | sp | | my | cc | | my | cc | | yo | sp | | yo | sp | | yo | cc | | yo | cc | ______________ my question is this: what query will give me this result ______________ | site | cat | ______________ | my | sp | | my | cc | | yo | sp | | yo | cc | ______________ i am very new …

Member Avatar
Member Avatar
+0 forum 6

I am new to Qt and I'm trying to connect a remote database. QSqlDatabase db = QSqlDatabase::addDatabase( "QMYSQL" ); db.setHostName("IP ADRESS"); // local or IP db.setPort(3306); // Default port is 3306 db.setUserName("DB USER"); // example root db.setPassword("PASSWORD"); db.setDatabaseName("DB NAME"); if( !db.open() ) { qDebug() << db.lastError(); qFatal( "Failed to connect." ); } qDebug( "Connected!" ); QSqlQuery qry; qry.prepare( "CREATE TABLE IF NOT EXISTS data (id INTEGER UNIQUE PRIMARY KEY, firstname VARCHAR(30), lastname VARCHAR(30))" ); if( !qry.exec() ) qDebug() << qry.lastError(); else qDebug() << "Table created!"; ... goes on this code works like a charm in local but when i give …

Member Avatar
Member Avatar
+0 forum 5

I am developing an android application using java with SQLite. The following code make the error: String selectQuery = "SELECT * FROM User"; Cursor cursor = db.rawQuery(selectQuery, null); I checked my program and I found that the cursor make unfortunatly error. Please help from where is the error come??

Member Avatar
Member Avatar
+0 forum 9

Hi Guys , I couldnt dispay sum of a column of sqlite database in php . I tried the sql statement in database its working fine but not sure how to dispay the result in PHP . I belive i need to fetch it and then dispay any help will be appreciate . Thanks in advanced . Sql statement : <?PHP $dbhandle = new PDO('sqlite:test.sqlite'); $query = $dbhandle->query("SELECT COALESCE(SUM(Qty) ,0) AS TOTAL FROM RMA where (Status='Returne')"); ?>

Member Avatar
Member Avatar
+0 forum 3

can anyone help me in configuring the sqlite with php. I have tried changing the php.ini and enabling the extension from the extensions list. I am using the wamp for development. Please fix my error. Thanks in advance

Member Avatar
Member Avatar
+0 forum 3

Hello, Everyone, I need your help with my code, I am trying to display the image from database to picturebox but I can't figure it out. Below is my code: Private Sub LoadImage(ByVal ind As Integer) Dim cn As New SQLiteConnection("Data Source=C:\db\QC_ASD_2013_08_09.qdb") Dim cmd As New SQLiteCommand(String.Concat("SELECT beeld_data FROM image WHERE port_item_id=", ind), cn) Dim da As New SQLiteDataAdapter(cmd) Dim ds As New DataSet() da.Fill(ds, "image") Dim c As Integer = ds.Tables("image").Rows.Count If c > 0 Then Dim bytBLOBData() As Byte = _ System.Text.Encoding.UTF8.GetBytes(ds.Tables("image").Rows(c - 1)("beeld_data")) Dim stmBLOBData As New MemoryStream(bytBLOBData) PictureBox1.Image = Image.FromStream(stmBLOBData) End If End Sub It always …

Member Avatar
Member Avatar
+0 forum 7

On the form user enter rego no where it search database and display the output what i am looking is, if the entered data not match its should display " Record not found." <?php $search_Rego = ($_POST['RegoNo']); try { //open the database $db = new PDO('sqlite:iSearch.sqlite'); $result = $db->query("SELECT Fname , Lname , RegoNo, Model, Color, MobNo, DeskNo, AltMobNo FROM Owner JOIN Cars ON Owner.id=Cars.Owner_id JOIN Contacts ON Owner.id=Contacts.Owner_id where RegoNo like '$search_Rego'"); { foreach($result as $row) { echo " This Car Belongs to " ; echo "<br />"."<br/>"; echo $row['Fname']." ". $row['Lname']."<br />"; echo $row[ 'RegoNo']. "<br/>"; echo $row['Model']." …

Member Avatar
Member Avatar
+0 forum 5

Hi all, I have recently been give a project to create an invoicing system for a small business. The system needs to be able to easily add new customers and store them for usage within invoices. There also needs to be a form to enter invoice data and invoices need to be printable to a format which will match up with pre-printed invoice paper. Naturally, I will need a database to accomplish this, but this database should be portable so it can be used on multiple machines (Linux and Windows, never simultaneously.) I attempted to create this entire system using …

Member Avatar
Member Avatar
+0 forum 3

I have a csv that needs to be put into a database format so I can sort and count the data. My approach has been to use python csv and sqlite modules. I am communicating with the database and creating one of the 2 tables. Second table has many more rows and I am wanting to use an append to db model which isn't working. The code is def load_titles(f): filename = f titles=[] with open(filename, 'rb') as mycsv: reader = csv.reader(mycsv) counter = 0 for counter,row in enumerate(reader): if counter < 1: continue if counter > 6: break titles.append(row) …

Member Avatar
Member Avatar
+0 forum 3

How to install Sqlite in windows OS and how to customize the database table in sqlite and, Tools for sqlite working like mysql workbench.

Member Avatar
Member Avatar
+0 forum 1

Hello I modified tutorial code found at http://www.codeproject.com/Articles/119293/Using-SQLite-Database-with-Android?fid=1592519&df=90&mpp=25&noise=3&prof=False&sort=Position&view=Quick&spc=Relaxed&fr=1#xx0xx to create an assignment list app, and when I click modify, delete, or cancel it force closes. Here is my DatabaseHelper.java code: public class DatabaseHelper extends SQLiteOpenHelper { static final String dbName="assignDB"; static final String employeeTable="Assignments"; static final String colID="assignID"; static final String colName="assignName"; static final String colAge="dueDate"; static final String colDept="Course"; static final String deptTable="Course"; static final String colDeptID="CourseID"; static final String colDeptName="CourseName"; static final String viewEmps="ViewAssignments"; public DatabaseHelper(Context context) { super(context, dbName, null,33); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub …

Member Avatar
+0 forum 0

I want to develop a simple application which runs on single computer (just runs in one mechine) and did not need network. Program has to store some data in database and show them for printing. I have no experience with real-word program so I confused here: If the program is so simple why should I use sql-server or crystal report; What is benefit of using them? What is benefit of not using them? I can use a Sqlite file or sdf file or sql-server for storing data and I can generate a html file or use crystal-report for printing the …

Member Avatar
Member Avatar
+0 forum 1

I need help figuring out how to fix my code. Every time I run the code its traceback is to this part of it. My code is Unbound Local Error for 'result'. Please see code below: def Level1(self): sql = "SELECT easyhint, gps, qrcode FROM gamedb WHERE quad = 1 ORDER BY RANDOM () LIMIT 1;" try: cursor.execute(sql) result = cursor.fetchmany(size = 7) except Exception, e: print e for row in result: while 'easyhint' < 8: if 'gps' in row and 'number' in self.person: return row.easyhint.itervalues() else: return 0 Any help or suggestions are welcomed. Any help or suggestions are …

Member Avatar
Member Avatar
+0 forum 1

Below is a documented code example showing how to use the SQLite functions to connect and query your database (and check for errors). Please note that using the SQLite extension is NOT RECOMMENDED. This extension is no longer available in PHP 5.4.0. If you want your scripts to be future proof it is better to switch to PDO. If there are any questions let me know.

Member Avatar
+2 forum 0

I'm working on an app and I am having some trouble getting the login and registration to work. Here is the code I have for my registration. public class RegisterActivity extends Activity { Button btnRegister; Button btnLinkToLogin; EditText inputFullName; EditText inputEmail; EditText inputPassword; TextView registerErrorMsg; //JSON Response node names private static String KEY_SUCCESS = "success"; private static String KEY_UID = "uid"; private static String KEY_NAME = "name"; private static String KEY_EMAIL = "email"; private static String KEY_CREATED_AT = "created_at"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); // Importing all assets like buttons, text fields inputFullName = (EditText) findViewById(R.id.registerName); inputEmail …

Member Avatar
Member Avatar
+0 forum 1

Hi i am having problems designing a solution for this problem : I have a form where you can choose the items you wish and type the quantity and then add them to a listview item. The itema are already saved in a database ( i am using sqlite ) but then i have to save this 'order' back into my database so i can retrieve it later for printing or just viewing what was on the 'order'. The problem is i can't figure a way to do so... I already created tables that include my items and their ids …

Member Avatar
Member Avatar
+0 forum 3

how to access a web service from a mobile POS Device application in c and to store the accessed data in the device to use it (like printing bills for a collection) when it is required.can anyone please give any guidance for the above requirement iam totally new with POS development and i have only reached the first stage of research on available details on POS which i should say was not very successful.any valuable information regarding the same will be great

Member Avatar
Member Avatar
+1 forum 1

For my project, these two queries don't work. The sqlite manual says to use 'qualified-table-name' but if I do (flist.fdata) an error is returned 'no such table'. As they are below no errors are returned, but the database table is not affected. if (isset ($_POST['del'])) { $id = $_POST['id']; $titl=$_POST['titl']; $db = sqlite_open('data/flist.sqlite', 0666, $sqliteerror); sqlite_query($db,"DELETE FROM fdata WHERE id='$titl'"); header('location:index.php'); sqlite_close($db); } if (isset ($_POST['alter'])) { $id=$_POST['id']; $title=$_POST['titl']; $art=$_POST['art']; $cat=$_POST['cat']; $len=$_POST['len']; $db = sqlite_open('data/flist.sqlite', 0666, $sqliteerror); sqlite_query($db,"UPDATE fdata SET title='$title',artist='$art', category='$cat',length='$len' WHERE id='$id'"); header('location:index.php'); sqlite_close($db); } I've also tried 'main.fdata' but that doesn't work either. Can someone point me …

Member Avatar
Member Avatar
+0 forum 7

I saved some images in an sqlite database but when i tried to display them using static bitmap i get an error OnOpenEdit self.frmEdit.imageCtrl.SetBitmap((i[7])) File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py", line 1229, in SetBitmap return _controls_.StaticBitmap_SetBitmap(*args, **kwargs) TypeError: in method 'StaticBitmap_SetBitmap', expected argument 2 of type 'wxBitmap const &' here is a print of the data from sqlite [(1, u'one', u'two', <read-write buffer ptr 0x03155C00, size 74913 at 0x03155BE0>, u'four')] i felt it may have to do with conversion but since a lot of people don't support storing images in databases there is not much information on this. I would also like to know …

Member Avatar
+0 forum 0

Hi all,Anyone know of a decent free sqlite manager. One that will work with sqlite not sqlite3. Ive tried some and not been able to find one that works!

Member Avatar
Member Avatar
+0 forum 5

To All Pythonist.. I have small SQLITE db.. for User Table 'SELECT loginUser from User'; sql = cursor.fetchall() listSQL = sql[:] for x in listSQL: print x listSQL SELECT Data Produce: (u'user1',) (u'user2',) (u'user3',) I want to match the list of user with a string input: example if the value of the current user = ('user1') it should match on the registered user in the current table.

Member Avatar
Member Avatar
+0 forum 1

I'm trying to write a simple sqlite query in c++ using visual studio 2010. My problem is that i can't use a c++ variable inside that query. I was not able to find the right syntax. `sqlite3_prepare_v2(handler, "SELECT * FROM grammateas WHERE username==X;", -1, &statement, 0);` where X i would like to use a variable. In php and mysql is very simple, but here things are more complicated! Ī¤hanks in advance.

Member Avatar
Member Avatar
+0 forum 2

hii..i am new to android..i am developing an android application on platform 2.1.. There are two textbox: one for Name and other for entering job.I want the values should be taken from the 2 textboxes editText1 and editText2 and inserted in my database whenever a user clicks the button.Please help im stuck in this part. my code is creating the table, but values are not being inserted into it. here are my two classes: DbHelper.java package test.db.help; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class DbHelper extends SQLiteOpenHelper { public static final String db_name = "mydb.db"; public static …

Member Avatar
Member Avatar
+0 forum 1

The End.