mysql

sqlite table, using a name+value table?

I am working on a problem. The problem is i have multiple links to a file, and a link to multiple links to a single file (files that are protected and have a userid+key thus require a different link). So for my file i have the fileid, path and misc data (i called it status for now). Is this table structure good? I am using sqlite and ma...

Showing data and counting from multiple databases in MySQL

I have two tables, that is joined in some way. I've spent the last hour googling around, not finding any concrete answers that worked in my case. The case is, table 1 is called Clients, and table 2 is called Projects. I need to list all the client names, followed by number of projects related to that project and the project title. For ...

Javascript and MySQL

I want to build an entire web app using only Javascript and MYSQL . Anyone know how I can go about this if it's possible. Thank you. p ...

Web Service with lots of connections

Hi guys, I'm planning the development of a web service that has to be very scalable, in order to process many concurrent connections, probably thousands. The service wil act as an API. It has to be highly responsive, a delay of 3 seconds between request and reply is considered too much. Maybe the service could be distributed among many...

Large Text and Images In SQL

Is it a good idea to store large amounts of text (eg html pages) inside your SQL database? Or is it a better idea to store it as html files in the filesystem? The same goes for images - is it a good idea to store image data in the database or better to put them on disk? Will storing large amounts of data cause me performance problems f...

SQL query returning int column of relative order

Say I have table with two columns: Name, Age. I want to design a query that will return the names and ages sorted by age, but to also have an additional column which will run from 1 to N (the last row). So for a table with the following rows: John, 28 Jim, 30 Mike, 28 The following rows will be returned John, 28, 1 Mike, 28, 2 Jim,...

SSIS - Data from MySql to MsSql some characters are ?

hi there I just transferred some data from MySql to MsSql (2K5) in a text field, some of my characters, such as apostrophes, are now ? (question mark) to me this indicates some sort of collation or character set error, right? To be honest, I don't know which one should I be using The MySql db currect charset is utf8_general_ci and in ...

mysql query

i have the following table in my databse.. CREATE TABLE IF NOT EXISTS `client` ( `CARD_NO` varchar(15) NOT NULL, `F_NAME` varchar(20) NOT NULL, `L_NAME` varchar(20) NOT NULL, `SEX` varchar(5) NOT NULL, `DOB` date NOT NULL, `SUBCITY` varchar(10) NOT NULL, `KEBELE` varchar(5) NOT NULL, `HOUSE_NO` varchar(10) NOT NULL, `T...

@@DBTS in MySql

Hey guys, I want to ask if there is an equivalent to the @@DBTS TSQL global variable in MySql (I need to access the timestamp of the last row that has been accessed in the whole database, not just one table). I need this because I'm trying to use Microsoft Sync Framework and MySql for bi-directional syncing. Any help will be much appre...

What's the best way to implement a counter field in MySQL

I want to start counting the numbers of times a webpage is viewed and hence need some kind of simple counter. What is the best scalable method of doing this? Suppose I have a table Frobs where each row corresponds to a page - some obvious options are: Have an unsigned int NumViews field in the Frobs table which gets updated upon each...

What is difference between autoReconnect & autoReconnectForPools in MySql connector/J ?

In the configuration reference for MySql's connector J driver, a caveat emptor is issued on the use of the autoReconnect property. I followed the instructions and increased my server's *wait_timeout*. Since I am using DBCP (I am considering moving to c3po after reading several posts on Stackoverflow shooting down DBCP ), is it ok to use ...

Why can Wordpress suddenly connect to the MySQL database server once I update the host from "localhost" to "mydomain.com" when I have VirtualHosts set up in Apache?

This is a specific variation on the "can't connect" problem. In my case, I've just set up two virtual hosts in my httpd.conf listening on port 80. The declaration looks like: NameVirtualHost *:80 <VirtualHost *:80> ServerName site1.dev DocumentRoot /www/site1 </VirtualHost> <VirtualHost *:80> ServerName site2.dev Do...

Book recommendations: PHP/MySQL and Dreamweaver ?

I need a book that discusses PHP, mySql and Dreamweaver as I have a project and i don't know either of these technologies, so i need something to give me a headstart. ...

PHP to store images in mysql or not?

I have built a small web application in PHP where users must first log in. Once they have logged in, I intend on showing a small thumbnail as part of their "profile". I will have to ensure the image is below a particular size to conserve space, or ensure it is a particular resolution, or both, or even perhaps use something like image ma...

TypeError: 'NoneType' object is not iterable

I need to process mysql data one row at a time and i have selected all rows put them in a tuple but i get the error above. what does this mean and how do I go about it? ...

MySQL next/previous ids (arbitrary sort order)

Here is my table: mysql> describe ps; +-------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | a | text | YES | | NULL | |...

Trouble with CONCAT and Longtext

The SQL... UPDATE Threads t SET t.Content = ( SELECT GROUP_CONCAT(a.Content ORDER BY a.PageID SEPARATOR '<!-- pagebreak -->') FROM MSarticlepages a WHERE a.ArticleID = t.MSthreadID GROUP BY a.ArticleID ) As you can see it takes all of an article's pages (which are each stored as longtext in separate rows) and GROUP_CONCA...

MySQL equivalent session variable for Oracle

In MySQL, I can create an access a session variable by using a single @. Example initialization: set @myVar = true; Some trigger containing this code: if (@myVar is not true) then execute something What is the equivalent in Oracle 10g? ...

Where can I find the code CD for my Kindle Edition of PHP and MySQL Web Development, 4th Ed?

I just bought PHP and MySQL Web Development 4th Edition by Welling and Thompson. The book uses examples from the CD-ROM, which appears to not come with the Kindle Edition. Is there any way to download, legally or questionably, the CD that contains the code samples? I'm finding the book really useful, but don't want to manually type in al...

Using Msql views in a Ruby on Rails app to improve performances

I'm having some performances issues in a rails project (running on rails 2.0.5), for example in my user administration pages. my user model has many relations (details, addresses, roles...) who get loaded with eager loading. That creates really huge SQL queries, for some cases, it takes almost a minute to load 30 users. On the other han...