I have a session class that needs to store session information in a MySQL database. Obviously I will need to query the database in the methods of this class. In general I may need to connect more than one database simultaneously and may or may not be connected to that database already.
Given that, what's the best way to access datab...
In the following code, used to get a list of products in a particular line, the command only returns results when I hard code (concatenate) productLine into the SQL. The parameter substitution never happens.
+ "lineName = '@productLine' "
+ "and isVisible = 1 ";
MySqlDataAdapter ad...
I needed to re-install my computer but I didn't think about exporting the data from mysql 5.
How do I get the data from the old installation into the new installation, is this just copying the data directory or do I have to take other steps to get to the data?
...
I acquired a database from another developer. He didn't use auto_incrementers on any tables. They all have primary key ID's, but he did all the incrementing manually, in code.
Can I turn those into Auto_incrementers now?
...
I have a MySQL database behind a firewall which can only be accessed via an SSH connection. Does anyone know of an implementation of java.sql.Connection which would allow me to make an SSH connection to this database?
...
When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.
Is there a better way of doing an upgrade of the MySQL. Becaus...
Hello,
I am trying the following code:
<?php
$link = mysql_connect('localhost', 'root', 'geheim');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$query = "SELECT * FROM Auctions";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, ...
Hello,
I have the following code:
<?php
$link = mysql_connect('localhost', 'root', 'geheim');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db(ebay);
$query = "SELECT * FROM Auctions";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array(...
For example if I have an auto-numbered field, I add new records without specifying this field and let DB engine to pick it for me.
So, will it pick the number of the deleted record? If yes, when?
// SQL Server, MySQL. //
Follow-up question: What happens when DB engine runs out of numbers to use for primary keys?
...
My table structure looks like this:
tbl.users tbl.issues
+--------+-----------+ +---------+------------+-----------+
| userid | real_name | | issueid | assignedid | creatorid |
+--------+-----------+ +---------+------------+-----------+
| 1 | test_1 | | 1 | 1 | 1 |
| 2...
In a table, I have three columns - id, name, and count. A good number of name columns are identical (due to the lack of a UNIQUE early on) and I want to fix this. However, the id column is used by other (4 or 5, I think - I would have to check the docs) tables to look up the name and just removing them would break things. So is there a g...
The HR department at the company that I am currently working for has requested that I provide a system for storing employee social security numbers in our company database. The reason for this is to streamline payroll completion, as we use in-house software for employee timesheets but have to integrate with third-party software for our a...
I suppose this question could just as easily be applied to PHP with regard to MSSQL. However, with some versions of MSSQL being so expensive, I always wondered, what is the real advantage of choosing it over MySQL for .NET development? Is it really difficult to use .NET tools in conjunction with a MySQL database? Why not create some sort...
how do i determine what a mysql db's charset is set to? in the cli?
...
I would like to construct a query that displays all the results in a table, but is offset by 5 from the start of the table. As far as I can tell, MySQL's LIMIT requires a limit as well as an offset. Is there any way to do this?
...
Hi everyone,
I am working on a PHP application that intends to ease company workflow and project management, let's say something like Basecamp and GoPlan.
I am not sure on what the best approach is, database-wise. Should I use a single database and add client-specific columns to each of the tables, or should I create a database for eac...
Do you know any applications to synchronize two databases - during development sometimes it's required to add one or two table rows or new table or column.
Usually I write every sql statement in some file and during uploading path I evecute those lines on my production database (earlier backing it up).
I work with mySQL and postreSQL da...
Is it generally better to run functions on the webserver, or in the database?
eg:
INSERT INTO example (hash) VALUE (MD5('hello'))
or
INSERT INTO example (hash) VALUE ('5d41402abc4b2a76b9719d911017c592')
Ok so that's a really trivial example, but for scalability when a site grows to multiple websites or database servers, where is it b...
Before few days I was at some IT conference here in Belgrade. On Agenda was a topic about MySql, and clustering in MySql, and the guys from MySql said that they have the best solution for cluster split brain problem, does anyone know something about this, is this true or just a marketing trick?
...
On my blog, I display in the right nav the 10 most popular articles in terms of page hits. Here's how I get that:
SELECT *
FROM entries
WHERE is_published = 1
ORDER BY hits DESC, created DESC
LIMIT 10
What I would like to do is show the top 10 in terms of page hits per day. I'm using MySQL. Is there a way I can do this in the database...