mysql

Dislay MySQL Data in a Label - Vb.Net

Hey guys, I have some code here that connects to my Mysql database. It checks your username and password and if your login was successful and it retrieves the phone number under that account. How would the SQL Query look like for retrieving the phone number once connected? Then how would I be able to display that phone number on a label...

right-hand-side MySQL functions in DBIx::Class

In DBIx::Class, when I generate a query using this syntax: ... 'Time(submitted_at)' => { '>' => 'Time(Now()-Interval ' . $wait_period . ' minute)' } ... The generated query is perfect except for the fact that the function on the right hand side is in quotes. ... AND ( Time(submitted_at) > 'Time(Now()-Interval 5 minute)' ) ... If i...

Why are my Cucumber tests keeping the MySQL connection alive after each scenario?

I was having a really odd problem in my cucumber tests that was causing scenarios that were passing individually, to fail when run with others in a feature. I deduced this was a MySQL related issue and sure enough, a co-worker came along and recommended I change my connection pool to a higher value in my database config. Lo' and behold, ...

MySQL Query Glitch

I have this MySQL Query glitch in my VB.NET program. Here is the query in VB.NET: "SELECT Points FROM user WHERE Username = '" & UsernameText.Text & "';" It will select the points column from the user table from the Username they entered. When I deploy this it will set the value for points to 0 on their account. What's going wrong? I...

html in varchar field?

I have a varchar(255) field in mysql that is used for displaying the title to a page and I received a request to superscript some characters for a particular title. I updated this title with some html but this doesn't render as expected. Instead of H2O I get: H<sup>2</sup>O Thanks! ...

SQL Joins, Count(), and group by to sort 'posts' by # of yes/no 'votes'

I have posts, votes, and comments tables. Each post can have N 'yes votes', N 'no votes' and N comments. I am trying to get a set of posts sorted by number of yes votes. I have a query that does exactly this, but is running far too slowly. On a data set of 1500 posts and 15K votes, it's take .48 seconds on my dev machine. How can I opti...

app that auto-generates CRUD UI for database table

I have a MySQL database that has a few very simple tables. I would like to find an app (implemented in Perl, Python or PHP) that will do the following: Point the app to a database table, and it automatically retrieves the table's schema from the database. It then generates an HTML view of the table's data. The data is displayed as a ...

Synchronize identical tables in separate databases with php

I'm trying to set up a PHP script to read a handful of MySQL tables from database A and then insert them into databases B and C. It's a really simple scenario - the tables being copied over can even be emptied or dropped before they have values inserted into them. All the databases are on the same server, and I don't need to preserve t...

jQuery + MySQL Noob Problems

I'm trying to get this to work, but no luck. It's 3am, so that may be the problem. What am I missing here? I'm trying to insert some data via jQuery to a local MySQL table. If I run save.php on its own, it inserts a blank row in the DB, so that works. Any ideas? **index.php** <html> <head> <link rel="stylesheet" type="text/css" hre...

Mysql how to flatten a result set

I have a stored procedure that will return a list of ids. I want to return that list as a comma separated string, i.e. "1,2,3,4,5". I know I can do this using a cursor but is there an easier way to turn a resultset into a flattened string? ...

I need help with a MySQL query.

Ok I have a table in my mysql query browser like shown below: NAME: Jobs: Kate Contractor John Janitor Bob Writer Don Waitress Let's say I want replace the job of Kate to artist. how would I do this as a MySQL Query. I know it involves the INSERT INTO thingy, but I'm not really sure. ...

Insert Not In Query And Update Difference

If I have two tables as listed below, The first which shows the Raw Data and the second which holds the Compressed Version of the Raw Data: raw_table: val 1 1 2 2 2 3 3 4 comp_table: val count 1 2 2 3 3 2 4 1 I want to compress the raw_data into another table INSERT INTO comp_table VALUES ( ...

How to Represent Rules using a MySQL Table?

I have a table of 100,000s of USERS (name, age, gender, phone, company, street, city, state, country, zipcode, etc). I also have a table of thousands of PROMOTIONS which are offered to users. Now, for each promotion I need to add a rule which defines which subset of users it applies to. For example, a rule might be: All users which hav...

Most efficient way to import data from one MySQL database to another

I'm writing a PHP script which imports data from tables in two different databases into another one. I've got it working ok with sample data, except now I've moved to using data closer resembling its final use: 25+ million records per table, and growing daily. Obviously, efficiency is a bit of a concern. Here's how it current works. I c...

What is the best way to go about creating a page of stickies with savable and retrievable content?

I have had a look at sticky notes with php and jquery and jStickyNote, and while both seem to look pretty nifty they lack some elements I am after. I haven't been able to find a way to allow particular users to modify the stickies they create, nor have I found a good way to save their stickies into my database. I am, and would like to ke...

Is it possible to get count(*) and * more efficiently ?

I'm now running two queries,which is not so efficient I think: select count(*) from table where id>0; select * from table where id>0 limit 10; ...

How to display an Image from a mysql blob.

I am trying to display an image from a MySQL blob field. I have tried a few different things and none of them seem to work. I have tried: header("Content-type: $type"); img src = $blobData; header("Content-type: $type"); echo($blobData); ...

MySQL: Returning multiple columns from an in-line subquery

I'm creating an SQL statement that will return a month by month summary on sales. The summary will list some simple columns for the date, total number of sales and the total value of sales. However, in addition to these columns, i'd like to include 3 more that will list the months best customer by amount spent. For these columns, I nee...

using subsonic with mysql

Hi, I was wondering if anyone knows a reference on how to configure subsonic 3.0 to use mySQL? ...

C# - XML vs MySQL

In this program I'm writing, it would need frequent database communication, and at the moment I'm using just XML files. Is there really a benefit from using MySQL or SQL in general over XML. Just note that I'm using C# so MySQL is not very fun to deal with in it (from what little experience I have). ...