Hey guys, hope this isn't too much of a n00b question
I'm mainly a front end developer that has recently started to do some back end programming. The script I'm working on is pretty simple (in theory). I just don't know where to begin and was hoping for some advice that will lead me in the right direction.
-The script is essentially a ...
What's the easiest way to install PDO on the default php installation of OS X Leopard? I'm trying to get ModX running.
...
I have a table with records that look like this:
CREATE TABLE sample (
ix int unsigned auto_increment primary key,
start_active datetime,
last_active datetime
);
I need to know how many records were active on each of the last 30 days. The days should also be sorted incrementing so they are returned oldest to newest.
I'm using ...
I've been requesting MySQL results and looping through them like this:
$query = "SELECT * FROM $table";
$result = mysql_query($query);
for($i = 0; $i < mysql_num_rows($result); $i++){
echo mysql_result($result, $i, $row);
//do something else;
}
you can probably see what happens. What if a row has been deleted? What if the firs...
I need to access and download data from a MySQL database without connecting to the database during development in VisualStudio. Is there a way to program it blindly (since I know what the database looks like) like its done in PHP?
Alternatively, can I use download the database schema and use it in Visual Studio?
...
I've a table where I've two fields:
dateCreated
dateUpdated
I want both fields to hold timestamps, dateCreated to have a DEFAULT CURRENT TIMESTAMP flag and dateUpdated to have a ON UPDATE CURRENT TIMESTAMP behavior, however seems that I can't have more than one timestamps field types on the same table.
It would be really useful if th...
I have a Rails application that uses MySQL. The application needs to populate sqlite databases to be distributed to client applications from the master mysql database. The schema for the sqlite database will be very similar to the mysql database, but not identical. The sqlite databases will be populated with a subset of the schema and ...
When I decided to use an OR/M (Entity Framework for MySQL this time) for my new project I was hoping it would save me time, but I seem to have failed it (for the second time now).
Take this simple SQL Query
SELECT * FROM POST ORDER BY addedOn DESC LIMIT 0, 50
It executes and gives me results in less than a second as it should (the ta...
Hi,
i've got two queries
first:
SELECT
players.username AS username,
tmp_player_operations.id AS tmp_id,
tmp_player_operations.operation_type AS operation_type,
tmp_player_operations.veryfication_code AS veryfication_code,
tmp_player_operations.expiration_date AS expiration_date,
tmp_player_operations.used AS ...
I saw couple of tools but all are paid, I have only one database in MySQL that we want to convert in MSSQL.
Suppose i create the schema by myself then is it possible to use OPENROWSET to open connection to mysql and import all data into sql with following statement?
INSERT INTO Customers
SELECT * FROM (
OPENROWSET (
'm...
Hi,
I have a query in MySQL (used in a stored procedure) which searches by name and another field. When I use different combinations of these search parameters, I get quick results (between 1 and 2s) but with some particular values, I get a query which takes 9s to return results on the production website.
The following is what I got out...
Ive got a table of thousands of products and 50 or so authenticated users.
These users all show the products on their own web sites and they all require the ability to have them ordered differently.
Im guesing i need some kind of seperate table for the orders which contains the product_id, user_id and order column?
How do i do this t...
I'm wondering if it is possible to return a result set with column names which are stored in a separate table. Is this possible or do I need a stored_procedure with variables. See link for mysql_dump and description of required resultset:
http://pastie.org/584865
...
I want to sort my result form mysql by date. I use the query like this:
<?php
$date = $db->get_query("select distinct created_date from comments");
$condate = '';
for($i=0; $i < count($date); $i++)
{
$condate = $date[$i]['created_date'];
$data = $db->get_query("select id,created_date from comments where created_date='$condate' order...
I need to update table and set table.related_id (column that "binds" the table with related table) to NULL where the table.related_id doesn't exist in the related_table as related_table.id.
example:
TABLE:
----------------------
id | name | related_id
----------------------
1 | aaa | 15
2 | bbb | 36
3 | ccc | 7
4 | xxx | 43
RE...
I have a table of pages in my database, each page can have a parent as below:
id parent_id title
1 0 Home
2 0 Sitemap
3 0 Products
4 3 Product 1
5 3 Product 2
6 ...
Following command will let me know the names of databases.
$ mysqlshow
But how do I know the number of tables in each database and also the number of empty tables?
for e.g.
db count empty
test 10 5
mydb 122 0
client 34 34
...
New to Joomla and mySql environment. Created a Joomla test environment on localhost but did not name the mySql database to that of the target ISP. Is there a way to rename the database so I can load to ISP?
...
Hi all,
I have a table with statistics and a field named time with Unix Timestamps.
There are about 200 rows in the table, but I would like to change the Unix timestamps to MySQL DATETIME.
Without losing the current rows.
What would be the best way to update the Unix Timestamp to MySQL's DATETIME?
The current table:
CREATE TABLE `s...
Hi guys,
I wonder if it would be possible to query two tables as pictured bellow, and achieve the following result.
The two tables are (note that the page_id in the pages_contents table corresponds to the id column in the pages table.):
Wanted result (the two tables are joined by the biggest version number):
Thanks in advance for...